Skip to content

API docs · Chat & images

Chat quickstart

Call Claude and GPT with the OpenAI SDK, the Anthropic SDK, Claude Code or cURL by changing only the base URL and key.

Besides video generation, Global site offers chat models such as Claude, GPT, Kimi and DeepSeek. The API is compatible with both the OpenAI and the Anthropic formats, so existing SDKs, Claude Code and other clients work as soon as you point the base URL at this site and use your platform API key.

1. Create a key with the Chat scope

On the API keys page in the console, create a key and tick chat:create. An empty model allowlist means every model enabled for your account; if you set an allowlist, the chat models you call must be on it. If your account has no chat models yet, check the models and pricing page and contact us to enable them.

2. Pick an API format

FormatEndpointAuth headerBest for
OpenAIhttps://api.aitoken.tools/v1/chat/completionsAuthorization: Bearer …The openai SDK, LangChain and other OpenAI-compatible clients
Anthropichttps://api.aitoken.tools/v1/messagesx-api-key: …The anthropic SDK, Claude Code
OpenAI Responseshttps://api.aitoken.tools/v1/responsesAuthorization: Bearer …Codex

All of these endpoints accept either Authorization: Bearer or x-api-key. For the OpenAI SDK set base_url to https://api.aitoken.tools/v1; for the Anthropic SDK and Claude Code set the base URL to https://api.aitoken.tools (the SDK appends /v1/messages itself).

3. Use this site's model names

Set model to a model name from this site (see chat billing or the entries with kind chat in GET /v1/models); responses carry the same name in model. Whether a model is also available in the Anthropic format is shown by formats in its capabilities.

Use the API base URL shown above, https://api.aitoken.tools/v1. /v1 on the website domain runs a browser check and may return 403 for some scripts' default User-Agents (such as Python urllib); the API base URL does not.

Codex and Claude Code

For the full Claude Code and Codex setup, the model mapping variables, limitations and troubleshooting, see Connect Codex and Claude Code.

export ANTHROPIC_BASE_URL="https://api.aitoken.tools"
export ANTHROPIC_API_KEY="$AITOKEN_API_KEY"
export ANTHROPIC_MODEL="claude-sonnet-4-5"
claude