Integrates TokenLab chat, image, audio, video, and other API families into code with runnable examples, model discovery, public contract checks, and agent-fi...
Memory
TokenLab Native Endpoints
Try itUse TokenLab native endpoint families such as Responses, Anthropic Messages, Gemini generateContent, media, audio, embeddings, and translations when OpenAI-c...
What it does
Use TokenLab native endpoint families such as Responses, Anthropic Messages, Gemini generateContent, media, audio, embeddings, and translations when OpenAI-c...
The skill document
TokenLab Native Endpoints
Use this skill when a user needs provider-native behavior, non-chat APIs, or migration guidance beyond OpenAI-compatible /v1/chat/completions.
What this skill should deliver
- A clear endpoint choice and why it fits the request.
- A minimal request example with the correct base URL and auth header.
- A note on when OpenAI-compatible chat remains the simpler path.
- A fail-closed contract check for non-chat or provider-native request shapes.
- A recovery path when TokenLab returns a native endpoint hint or contract error.
Endpoint families
- OpenAI-compatible chat:
POST https://api.tokenlab.sh/v1/chat/completions - OpenAI Responses:
POST https://api.tokenlab.sh/v1/responses - Anthropic Messages:
POST https://api.tokenlab.sh/v1/messages - Gemini native generate content:
POST https://api.tokenlab.sh/v1beta/models/{model}:generateContent - Model catalog:
GET https://api.tokenlab.sh/v1/models - Task-specific model shortlist:
GET https://api.tokenlab.sh/v1/models?recommended_for= - Model contract:
GET https://api.tokenlab.sh/v1/models/:model
Preferred approach
- Start with OpenAI-compatible chat unless the user needs a native contract, non-chat API, or provider-specific behavior.
- If a previous response includes
X-TokenLab-HintorX-TokenLab-Native-Endpoint, treat it as routing evidence and prefer the exact native route in the header. - For Anthropic-style requests, use
/v1/messagesand preserve Anthropic request semantics instead of converting blindly. - For Gemini-style requests, preserve Gemini content parts, roles, tools, and generation config when the user explicitly needs Gemini-native behavior.
- For media/audio/embedding/rerank/translation requests, inspect
GET /v1/models/:modelbefore changing request parameters.
Output format
- One sentence naming the chosen endpoint.
- One runnable code block or cURL block.
- One short explanation of why this endpoint fits.
- One recovery note naming the catalog or contract endpoint to check if the call fails.
Avoid
- Do not flatten native Anthropic or Gemini request semantics into generic OpenAI chat unless the user explicitly accepts that tradeoff.
- Do not remove unsupported fields just to make validation pass when doing so would change output, safety, billing, or response guarantees.
- Do not hardcode media request shapes without inspecting the model contract.
- Do not expose private TokenLab routing, channel, or physical provider internals.
Edge Cases
- If the model supports both OpenAI-compatible and native routes, pick the simpler path unless the user needs native behavior.
- If the endpoint hint conflicts with the user's explicit requirement, explain the tradeoff and ask for confirmation before changing semantics.
- If a request fails with a contract error, use supported operations and recommended request fields to repair it.
Related skills
Pick TokenLab models for chat, coding, image, video, audio, embeddings, reranking, and translation by reading public model catalog signals before recommendin...
Choose TokenLab models and fallback chains using public pricing, task fit, latency expectations, and native endpoint needs before writing production routing...
Estimate LLM task token usage, cost, and duration using rule-based classification and optional local profile data without external dependencies.
Token Metrics (tokenmetrics.com). Use this skill for ANY Token Metrics request — searching and reading data. Whenever a task involves Token Metrics, use this skill instead of calling the API directly.
Token-efficient, safe agent execution