OpenAI-compatible API
Use TokenAir with OpenAI-compatible SDKs, headers, and chat completion requests.
Base URL
Use this base URL for TokenAir API requests:
https://api.tokenair.ai/v1Authentication header
Send your API key as a bearer token.
Authorization: Bearer your_tokenair_api_key
Content-Type: application/jsonEnvironment 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
| Field | Required | Notes |
|---|---|---|
| model | Yes | Use a model ID available to your account. |
| messages | Yes | OpenAI-compatible chat message array. |
| temperature | No | Controls sampling when supported by the selected model. |
| max_tokens | No | Limits generated output when supported by the selected model. |
| stream | No | Streaming 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.