Documentation menu
API basics

OpenAI-compatible API

Use TokenAir with OpenAI-compatible SDKs, headers, and chat completion requests.

ReferenceLast updated: July 2, 2026

Base URL

Use this base URL for TokenAir API requests:

https://api.tokenair.ai/v1

Authentication header

Send your API key as a bearer token.

Authorization: Bearer your_tokenair_api_key
Content-Type: application/json

Environment variables

TokenAir examples use these two variables so code can move between local development, CI, and production without hard-coded secrets.

export TOKENAIR_BASE_URL="https://api.tokenair.ai/v1"
export TOKENAIR_API_KEY="your_tokenair_api_key"

Chat completions

TokenAir is designed for OpenAI-compatible chat completion usage. Use the model IDs enabled for your account.

curl https://api.tokenair.ai/v1/chat/completions \
  -H "Authorization: Bearer $TOKENAIR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5-mini",
    "messages": [
      { "role": "user", "content": "Write a short launch checklist." }
    ]
  }'

Request fields

FieldRequiredNotes
modelYesUse a model ID available to your account.
messagesYesOpenAI-compatible chat message array.
temperatureNoControls sampling when supported by the selected model.
max_tokensNoLimits generated output when supported by the selected model.
streamNoStreaming availability can depend on model and account configuration.

Response shape

For chat completions, expect the familiar OpenAI-compatible response pattern: an ID, object metadata when available, achoices array, and usage information when the selected model reports token counts.

{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "..."
      }
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 24,
    "total_tokens": 36
  }
}

Model families

TokenAir supports model families including GPT, Claude, Gemini, DeepSeek, Qwen, GLM, MiniMax, Kimi, and other supported models. Exact model IDs and availability can depend on onboarding, account configuration, and upstream availability.

Next steps