OpenAI-Compatible Format — Unified LLM API Documentation
Overview#
All the following model providers support invocation via the OpenAI-compatible format. The request format is fully consistent with the OpenAI chat/completions API.Simply replace the model parameter in the request body with the desired model name to call models from different providers — no other code changes required.
API Endpoint#
https://api.tokenhot.ai/v1/chat/completions
Usage#
Simply replace the model parameter with the model name you need.
| Item | Description |
|---|
| Base URL | https://api.tokenhot.ai |
| Method | POST |
| Path | /v1/chat/completions |
| Auth | Bearer Token (add Authorization: Bearer YOUR_API_KEY to request headers) |
| Content-Type | application/json |
Supported Models#
1. GPT (OpenAI)#
OpenAI's GPT series — the world's leading large language model family. The latest GPT-5.x series continues to push boundaries in reasoning, code generation, and multimodal capabilities, with full support for Function Calling and streaming output.
| Model Name (model value) | Description | Context Window |
|---|
gpt-5.5 | Latest flagship, the most powerful GPT model with top-tier reasoning and creative capabilities | 1M |
gpt-5.4 | Previous-gen flagship with strong general reasoning and multimodal understanding | 1M |
gpt-5.4-mini | Lightweight high-speed version, balancing performance and cost for high-throughput scenarios | 400K |
gpt-5.3-codex | Code-specialized model, deeply optimized for code generation, debugging, and refactoring | 1M |
2. Claude (Anthropic)#
Anthropic's Claude series, renowned for safety, long-context understanding, and precise instruction following. The latest Claude 4.x series excels in complex reasoning, code generation, and multilingual tasks.
| Model Name (model value) | Description | Context Window |
|---|
claude-opus-4.7 | Latest flagship, the most powerful Claude model with top-tier reasoning and deep analysis | 1M |
claude-opus-4.6 | Previous-gen flagship with excellent complex task handling and long-text comprehension | 1M |
claude-sonnet-4.6 | Balanced model, the best trade-off between performance and speed for most scenarios | 1M |
claude-haiku-4.5 | Lightweight high-speed model with ultra-fast response and great cost-efficiency | 200K |
3. Gemini (Google)#
Google's Gemini series with native multimodal architecture, supporting text, image, audio, video, and more. The latest Gemini 3.x series further enhances reasoning and tool-use capabilities.
| Model Name (model value) | Description | Context Window |
|---|
gemini-3.1-pro-preview | Latest flagship preview, Gemini 3.1 Pro with top-tier reasoning and multimodal capabilities | 1M |
gemini-2.5-pro | Previous-gen Pro with strong reasoning, coding, and multimodal comprehension | 1M |
gemini-3.1-flash-lite-preview | Latest lightweight preview, ultra-fast responses for low-latency and high-throughput scenarios | 1M |
4. Qwen — Alibaba Cloud#
Alibaba Cloud's Qwen series, covering flagship, balanced, and high-speed tiers with full support for Function Calling and streaming output. The latest Qwen3.6 series further improves reasoning and multimodal capabilities with million-token context support.
| Model Name (model value) | Description | Context Window |
|---|
qwen3.6-plus | Latest flagship, Qwen3.6 top-tier model with comprehensive upgrades in reasoning, coding, and multimodal capabilities | 1M |
qwen3.6-flash | Latest high-speed, Qwen3.6 lightweight model with extreme cost-efficiency and fast responses | 1M |
qwen3.5-plus | Previous-gen flagship based on MoE architecture with outstanding logical reasoning, code writing, and multimodal capabilities | 1M |
qwen3.5-flash | Previous-gen high-speed based on Qwen3.5-35B-A3B architecture, high cost-efficiency and fast responses | 1M |
qwen3.5-397b-a17b | Next-gen native multimodal model (MoE), excelling in reasoning, coding, and visual understanding | 1M |
qwen-max | Classic flagship model for complex reasoning, code generation, and multilingual tasks | 32K |
qwen-plus | Balanced model with the best trade-off between performance, speed, and cost | 128K |
qwen-turbo | High-speed model for high-throughput general-purpose scenarios | 128K |
5. DeepSeek#
DeepSeek series models. The latest V4 series achieves major breakthroughs in inference efficiency and generation quality. V3.2 introduced the Sparse Attention mechanism (DSA), significantly reducing inference costs and improving long-context processing.
| Model Name (model value) | Description | Context Window |
|---|
deepseek-v4-pro | Latest flagship, V4 top-tier model with comprehensive improvements in reasoning, coding, and conversation | 1M |
deepseek-v4-flash | Latest high-speed, V4 lightweight model with ultra-fast response speed and cost-efficiency | 1M |
DeepSeek-V3.2 | Previous-gen flagship, a top-performing MoE model with DSA-optimized long-context processing | 128K |
DeepSeek-V3.2-Thinking | V3.2 chain-of-thought version, combining frontier CoT with sparse attention for deep reasoning | 128K |
DeepSeek-V3.2-Fast | V3.2 high-speed version for high-throughput scenarios | 128K |
deepseek-v3.1 | Previous-gen unified architecture model combining conversation, reasoning, and coding | 128K |
deepseek-reasoner | Classic reasoning model using chain-of-thought for deep logical reasoning | 128K |
⚠️ Notes for deepseek-reasoner:Does not support temperature, top_p, presence_penalty, or frequency_penalty parameters
Does not support Function Calling
Responses will include an additional reasoning_content field
For multi-turn conversations, remove reasoning_content from message history
6. xAI (Grok)#
xAI's Grok series. The latest Grok 4.x series features multi-agent collaborative architecture with support for ultra-long context and deep reasoning.
| Model Name (model value) | Description | Context Window |
|---|
grok-4.2-thinking | Latest flagship, chain-of-thought reasoning model for deep logic analysis and complex problem-solving | 2M |
grok-4.2 | Next-gen flagship with multi-agent collaborative reasoning for complex analysis | 2M |
grok-4.1 | Previous-gen flagship with enhanced conversational coherence while maintaining deep reasoning | 2M |
grok-4.1-fast | 4.1 high-speed version, the go-to for general tasks with low cost and high efficiency | 2M |
grok-4-fast-reasoning | High-performance reasoning model with optimized inference speed and efficiency | 2M |
grok-3-mini | Lightweight reasoning model with high efficiency and cost-effectiveness | 128K |
7. Zhipu AI (GLM)#
Zhipu AI's GLM series. The latest GLM-5.1 further upgrades reasoning depth and instruction following. GLM-5 features Dynamic Sparse Attention (DSA) with excellent performance in conversation, coding, and agent tasks.
| Model Name (model value) | Description | Context Window |
|---|
glm-5.1 | Latest flagship, the newest GLM model with comprehensive upgrades in reasoning depth and instruction following | 200K |
glm-5 | Previous-gen flagship with outstanding logical reasoning and complex instruction following | 200K |
glm-4.7 | Previous-gen classic, excelling in code generation and agent tasks | 200K |
glm-4.7-cc | 4.7 flagship-level agentic coding model, focused on complex task planning and full-stack coding | 200K |
glm-4.6 | Next-gen flagship model deeply optimized for complex agentic and engineering scenarios | 200K |
glm-4.5-air | Lightweight high-speed model with low cost and fast responses | 128K |
8. MiniMax#
MiniMax series models. The latest M2.7 series focuses on agent workflows and advanced reasoning, supporting both OpenAI and Anthropic protocols.
| Model Name (model value) | Description | Context Window |
|---|
MiniMax-M2.7 | Latest flagship with powerful self-evolution and complex engineering task capabilities | 204K |
MiniMax-M2.7-highspeed | M2.7 ultra-fast version, optimized for low-latency and high-throughput scenarios | 204K |
MiniMax-M2.7-cc | M2.7 cost-effective version for high-throughput coding and agent tool usage | 204K |
MiniMax-M2.5 | Previous-gen flagship, focused on code generation and refactoring | 204K |
MiniMax-M2.5-cc | M2.5 cost-effective version, designed for low-latency production environments | 204K |
9. Moonshot / Kimi#
Moonshot AI's Moonshot and Kimi series, renowned for ultra-long context processing and agent capabilities. The latest Kimi K2.6 further improves reasoning and multimodal capabilities, while K2.5 supports native multimodal and chain-of-thought reasoning.
| Model Name (model value) | Description | Context Window |
|---|
kimi-k2.6 | Latest flagship with comprehensive upgrades in reasoning and multimodal capabilities for more complex agent tasks | 256K |
kimi-k2.5 | Previous-gen flagship, native multimodal MoE model (1T parameters) with Agent Swarm collaboration | 256K |
kimi-k2.5-thinking | K2.5 chain-of-thought version with enhanced deep reasoning and step-by-step analysis | 256K |
kimi-k2 | Classic version with strong coding and agent capabilities | 256K |
moonshot-v1-128k | Classic ultra-long context model for large-scale document analysis | 128K |
moonshot-v1-32k | Medium context for document analysis and long conversations | 32K |
moonshot-v1-8k | Basic model for short conversations and everyday tasks | 8K |
Request Examples#
Python Example#
cURL Example#
OpenAI SDK Example (Python)#
Node.js Example#
Response Example#
Successful Response Structure#
{
"id": "chatcmpl-abc123def456",
"object": "chat.completion",
"created": 1711712000,
"model": "gpt-5.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing is a new computing paradigm based on the principles of quantum mechanics. Unlike classical computers that use bits (0 or 1), quantum computers use quantum bits (qubits), which can exist in a superposition of both 0 and 1 simultaneously..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 156,
"total_tokens": 184
}
}
Response Field Descriptions#
| Field | Type | Description |
|---|
id | string | Unique identifier for this request |
object | string | Always chat.completion |
created | integer | Unix timestamp of when the response was created |
model | string | The model name actually used |
choices[].message.role | string | Always assistant |
choices[].message.content | string | The content generated by the model |
choices[].finish_reason | string | stop = normal completion, length = max tokens reached |
usage.prompt_tokens | integer | Number of tokens consumed by the input |
usage.completion_tokens | integer | Number of tokens consumed by the output |
usage.total_tokens | integer | Total number of tokens consumed |
Request Parameters#
| Parameter | Type | Required | Default | Description |
|---|
model | string | Yes | — | Model name, see the supported models list above |
messages | array | Yes | — | List of conversation messages containing role and content |
temperature | number | No | 1.0 | Sampling temperature (0-2), higher values produce more random output |
top_p | number | No | 1.0 | Nucleus sampling probability (0-1), use either this or temperature |
max_tokens | integer | No | — | Maximum number of tokens to generate |
stream | boolean | No | false | Whether to enable SSE streaming output |
stop | string/array | No | — | Stop sequence(s), generation stops when encountered |
presence_penalty | number | No | 0 | Presence penalty (-2.0 to 2.0) |
frequency_penalty | number | No | 0 | Frequency penalty (-2.0 to 2.0) |
tools | array | No | — | Tool/function call definitions (supported by some models) |
response_format | object | No | — | Response format, e.g. {"type": "json_object"} (supported by some models) |
Message Roles in the messages Array#
| Role | Description |
|---|
system | System instructions defining AI behavior and role |
user | User input message |
assistant | AI's previous reply (for multi-turn conversations) |
Error Codes and Error Responses#
Error Code Overview#
| Status Code | Type | Description |
|---|
400 | BusinessError | Business validation failed — e.g., missing required parameters, model doesn't support the request format |
401 | GatewayError | Authentication failed — API Key is invalid, expired, or missing |
503 | GatewayError | Service unavailable — upstream channel error or service temporarily unavailable |
400 — Business Error (BusinessError)#
Returned when request parameter validation fails (e.g., missing required fields, model doesn't support a certain input format):{
"code": "video_url_required",
"message": "model doubao-seedance-2.0-V2V requires video_url content",
"data": null
}
| Field | Type | Always Returned | Description |
|---|
code | string | Yes | Business error code identifying the specific error type |
message | string | Yes | Detailed error description explaining the cause |
data | null | No | Business payload, always null on error |
401 / 503 — Gateway Error (GatewayError)#
Returned when authentication fails (401) or upstream channel is unavailable (503):401 Example (Invalid Token):{
"error": {
"code": "",
"message": "Invalid token (request id: 20260327...)",
"type": "new_api_error"
}
}
503 Example (Channel Unavailable):{
"error": {
"code": "model_not_found",
"message": "No available channel for the current group (request id: 20260330...)",
"type": "new_api_error"
}
}
| Field | Type | Always Returned | Description |
|---|
error | object | Yes | Error object details |
error.code | string | No | System error code, may be an empty string |
error.message | string | Yes | System error description, usually includes request id for troubleshooting |
error.type | string | Yes | Error type classification, e.g. new_api_error |
Note: Different models may have slight variations in parameter support (e.g., deepseek-reasoner does not support temperature). Please refer to each model's detailed description for specifics. If you have any questions, please contact TokenHot support.
Modified at 2026-06-22 09:55:45