Docs
DEVELOPER DOCUMENTATION

Connect models. Build your AI application.

From your first API call to cloud agents: model APIs, SDKs, streaming, tools, files and usage management guides.

Create an API key, discover an available model, send a request and verify usage in Token4AI Cloud.

Configure Codex, Claude Code, Pi, OpenClaw and Hermes with models, execution environments and tasks.

Configure Bearer, Anthropic and Gemini credentials; understand key rotation, scopes and billing groups.

One gateway, three familiar protocols

Base URLs
OpenAI-compatible  https://api.token4ai.cloud/v1
Anthropic          https://api.token4ai.cloud
Gemini REST        https://api.token4ai.cloud/v1beta/models/{model}:generateContent

Query the catalog with your key, then select a model that supports your protocol and task. Capabilities, permissions and prices depend on the current group.

Get started

Model APIs

Models and capability discoveryList models visible to your key and choose the appropriate model id, protocol and capabilities.Chat CompletionsUse the OpenAI-compatible chat endpoint for messages, conversation context, output controls and streaming.Responses and conversation stateUse the Responses API and understand input, stream, store, previous_response_id, retrieval and deletion.Anthropic Messages and token estimatesConfigure Anthropic-native requests, system instructions, content blocks, streaming and count_tokens.Gemini native content generationUse generateContent and streamGenerateContent with contents, parts and generationConfig.Streaming and connection handlingImplement SSE parsing, cancellation, timeouts and recovery without duplicate generation or false success states.Tool calling and structured outputBuild tool-call turns, validate function arguments and use JSON Schema for verifiable model output.Embeddings and rerankingBuild retrieval-augmented generation with embeddings and reranking, including input, dimensions and relevance scores.Vision input and image generationDistinguish vision understanding from generation, using image_url content parts and images/generations.Audio transcription, translation and speechUse audio/transcriptions, audio/translations and audio/speech with multipart uploads and binary output.Files API and file lifecycleUpload, list, retrieve, download and delete files; distinguish Files API objects, static assets and model input.Errors, 429 responses and retry policyDistinguish credential, validation, model, rate-limit and upstream errors, with bounded retries and request ids.

Agents & collaboration

Console & support

Token4AI Cloud connects model APIs with Agent Cloud workflows and shared token usage management. These guides take you from your first request to reliable task execution.