HomeTokenhotAPI Document
Tools
language
language
  • 中文
  • English
HomeTokenhotAPI Document
Tools
language
language
  • 中文
  • English
  1. API Document
  • OpenAI-Compatible Format — Unified LLM API Documentation
  • Quick Start
  • Image Models
    • DOUBAO
      • doubao-seedream-4-0-250828
      • doubao-seedream-4-5-251128
      • doubao-seedream-5-0-260128
      • doubao-seedream-4-0-250828 (image editing)
      • doubao-seedream-4-5-251128 (Picture editing)
      • doubao-seedream-5-0-260128 (image editing)
    • GPT
      • GPT Image-1.5
      • GPT Image-1.5 (image editing)
      • GPT Image-2 (image editing)
      • GPT Image-2
      • gpt-image-2-text-to-image
      • gpt-image-2-image-to-image
    • Gemini
      • gemini-3-pro-image-preview
      • gemini-3-pro-image-preview (image editing)
      • gemini-2.5-flash-image
      • gemini-2.5-flash-image (image editing)
      • gemini-3.1-flash-image-preview
      • gemini-3.1-flash-image-preview (image editing)
      • nano-banana-pro
      • nano-banana-2
      • nano-banana-2-lite
    • Dall
      • dall-e-2
      • dall-e-3
    • Wan
      • wan2.6-image (image editing)
      • wan2.6-image
    • Qwen
      • qwen-image-edit-max-2026-01-16
      • qwen-image-max
      • qwen-image-plus-2026-01-09
  • Video Models
    • DOUBAO
      • doubao-seedance-2-0-260128
      • doubao-seedance-2.0 (Get video task information)
      • doubao-seedance-2.0-V2V (Get video task information)
      • doubao-seedance-2.0-fast (get video task information)
      • doubao-seedance-2.0-fast-V2V (Get video task information)
      • doubao-seedance-2.0
      • doubao-seedance-2.0-V2V
      • doubao-seedance-2.0-fast
      • doubao-seedance-2.0-fast-V2V
    • Sora
      • Sora-2
      • Sora-2 (Get Video Task Status)
      • Sora-2 (Get Video Content)
    • MiniMax
      • MiniMax-Hailuo-02
      • MiniMax-Hailuo-2.3
      • MiniMax-Hailuo-2.3-Fast
      • Hailuo Get Video Info
    • HappyHorse
      • happyhorse-1.0-t2v
      • HappyHorse Get Video Info
      • happyhorse-1.0-video-edit
      • happyhorse-1.0-r2v
      • happyhorse-1.0-i2v
    • Kling
      • kling-v3
        • Text-to-Video (kling-v3)
        • First/Last Frame Video Generation (kling-v3)
        • Subject-Controlled Video Generation (kling-v3)
      • kling-v3-omni
        • Text-to-Video (kling-v3-omni)
        • First/Last Frame Video Generation (kling-v3-omni)
        • Subject-Controlled Video Generation (kling-v3-omni)
      • Create Subject
      • Query Subject
      • Query Video Task
    • Grok
      • grok-imagine-video-1-5-preview
      • Query Video Task
    • Veo
      • veo3.1
      • veo3.1 Video Extension (extend)
      • Query Video Task
    • Gemini
      • Create Character (omni character)
      • Create Voice (omni audio)
      • gemini-omni-video
      • Query Video Task
  • Chat Models
    • Claude
      • claude-sonnet-4-5-20250929
      • claude-opus-4-6
      • claude-opus-4-6-cc
    • GPT
      • GPT 5
      • GPT 5(Responses)
      • GPT 5.2
      • GPT 5.2(Responses)
      • GPT 5.4
      • GPT 5.4(Responses)
    • Gemini
      • gemini-2.5-flash
      • gemini-2.5-pro
      • gemini-3-flash-preview
      • gemini-3.1-pro
      • gemini-3.1-pro-preview
      • gemini-3.1-pro-preview (streaming)
    • Grok
      • grok-4.1
  • Audio Models
    • Gemini
      • gemini-2.5-flash-preview-tts
      • gemini-2.5-pro-preview-tts
    • Whisper
      • whisper-1 (audio translation)
      • whisper-1 (Audio to Chinese)
    • MiMo
      • mimo-v2.5-tts (Preset Voice Speech Synthesis)
      • mimo-v2.5-tts-voiceclone (Voice Cloning Speech Synthesis)
      • mimo-v2.5-tts-voicedesign (Text-Designed Voice Speech Synthesis)
  • Serve
    • Privacy agreement
    • Terms of Service
  1. API Document

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.

Basic Information#

ItemDescription
Base URLhttps://api.tokenhot.ai
MethodPOST
Path/v1/chat/completions
AuthBearer Token (add Authorization: Bearer YOUR_API_KEY to request headers)
Content-Typeapplication/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)DescriptionContext Window
gpt-5.5Latest flagship, the most powerful GPT model with top-tier reasoning and creative capabilities1M
gpt-5.4Previous-gen flagship with strong general reasoning and multimodal understanding1M
gpt-5.4-miniLightweight high-speed version, balancing performance and cost for high-throughput scenarios400K
gpt-5.3-codexCode-specialized model, deeply optimized for code generation, debugging, and refactoring1M

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)DescriptionContext Window
claude-opus-4.7Latest flagship, the most powerful Claude model with top-tier reasoning and deep analysis1M
claude-opus-4.6Previous-gen flagship with excellent complex task handling and long-text comprehension1M
claude-sonnet-4.6Balanced model, the best trade-off between performance and speed for most scenarios1M
claude-haiku-4.5Lightweight high-speed model with ultra-fast response and great cost-efficiency200K

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)DescriptionContext Window
gemini-3.1-pro-previewLatest flagship preview, Gemini 3.1 Pro with top-tier reasoning and multimodal capabilities1M
gemini-2.5-proPrevious-gen Pro with strong reasoning, coding, and multimodal comprehension1M
gemini-3.1-flash-lite-previewLatest lightweight preview, ultra-fast responses for low-latency and high-throughput scenarios1M

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)DescriptionContext Window
qwen3.6-plusLatest flagship, Qwen3.6 top-tier model with comprehensive upgrades in reasoning, coding, and multimodal capabilities1M
qwen3.6-flashLatest high-speed, Qwen3.6 lightweight model with extreme cost-efficiency and fast responses1M
qwen3.5-plusPrevious-gen flagship based on MoE architecture with outstanding logical reasoning, code writing, and multimodal capabilities1M
qwen3.5-flashPrevious-gen high-speed based on Qwen3.5-35B-A3B architecture, high cost-efficiency and fast responses1M
qwen3.5-397b-a17bNext-gen native multimodal model (MoE), excelling in reasoning, coding, and visual understanding1M
qwen-maxClassic flagship model for complex reasoning, code generation, and multilingual tasks32K
qwen-plusBalanced model with the best trade-off between performance, speed, and cost128K
qwen-turboHigh-speed model for high-throughput general-purpose scenarios128K

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)DescriptionContext Window
deepseek-v4-proLatest flagship, V4 top-tier model with comprehensive improvements in reasoning, coding, and conversation1M
deepseek-v4-flashLatest high-speed, V4 lightweight model with ultra-fast response speed and cost-efficiency1M
DeepSeek-V3.2Previous-gen flagship, a top-performing MoE model with DSA-optimized long-context processing128K
DeepSeek-V3.2-ThinkingV3.2 chain-of-thought version, combining frontier CoT with sparse attention for deep reasoning128K
DeepSeek-V3.2-FastV3.2 high-speed version for high-throughput scenarios128K
deepseek-v3.1Previous-gen unified architecture model combining conversation, reasoning, and coding128K
deepseek-reasonerClassic reasoning model using chain-of-thought for deep logical reasoning128K
⚠️ 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)DescriptionContext Window
grok-4.2-thinkingLatest flagship, chain-of-thought reasoning model for deep logic analysis and complex problem-solving2M
grok-4.2Next-gen flagship with multi-agent collaborative reasoning for complex analysis2M
grok-4.1Previous-gen flagship with enhanced conversational coherence while maintaining deep reasoning2M
grok-4.1-fast4.1 high-speed version, the go-to for general tasks with low cost and high efficiency2M
grok-4-fast-reasoningHigh-performance reasoning model with optimized inference speed and efficiency2M
grok-3-miniLightweight reasoning model with high efficiency and cost-effectiveness128K

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)DescriptionContext Window
glm-5.1Latest flagship, the newest GLM model with comprehensive upgrades in reasoning depth and instruction following200K
glm-5Previous-gen flagship with outstanding logical reasoning and complex instruction following200K
glm-4.7Previous-gen classic, excelling in code generation and agent tasks200K
glm-4.7-cc4.7 flagship-level agentic coding model, focused on complex task planning and full-stack coding200K
glm-4.6Next-gen flagship model deeply optimized for complex agentic and engineering scenarios200K
glm-4.5-airLightweight high-speed model with low cost and fast responses128K

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)DescriptionContext Window
MiniMax-M2.7Latest flagship with powerful self-evolution and complex engineering task capabilities204K
MiniMax-M2.7-highspeedM2.7 ultra-fast version, optimized for low-latency and high-throughput scenarios204K
MiniMax-M2.7-ccM2.7 cost-effective version for high-throughput coding and agent tool usage204K
MiniMax-M2.5Previous-gen flagship, focused on code generation and refactoring204K
MiniMax-M2.5-ccM2.5 cost-effective version, designed for low-latency production environments204K

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)DescriptionContext Window
kimi-k2.6Latest flagship with comprehensive upgrades in reasoning and multimodal capabilities for more complex agent tasks256K
kimi-k2.5Previous-gen flagship, native multimodal MoE model (1T parameters) with Agent Swarm collaboration256K
kimi-k2.5-thinkingK2.5 chain-of-thought version with enhanced deep reasoning and step-by-step analysis256K
kimi-k2Classic version with strong coding and agent capabilities256K
moonshot-v1-128kClassic ultra-long context model for large-scale document analysis128K
moonshot-v1-32kMedium context for document analysis and long conversations32K
moonshot-v1-8kBasic model for short conversations and everyday tasks8K

Request Examples#

Python Example#

Tip: Replace sk-********************************** with your actual API Key before use. Get your key at: https://tokenhot.ai/api-key

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#

FieldTypeDescription
idstringUnique identifier for this request
objectstringAlways chat.completion
createdintegerUnix timestamp of when the response was created
modelstringThe model name actually used
choices[].message.rolestringAlways assistant
choices[].message.contentstringThe content generated by the model
choices[].finish_reasonstringstop = normal completion, length = max tokens reached
usage.prompt_tokensintegerNumber of tokens consumed by the input
usage.completion_tokensintegerNumber of tokens consumed by the output
usage.total_tokensintegerTotal number of tokens consumed

Request Parameters#

ParameterTypeRequiredDefaultDescription
modelstringYes—Model name, see the supported models list above
messagesarrayYes—List of conversation messages containing role and content
temperaturenumberNo1.0Sampling temperature (0-2), higher values produce more random output
top_pnumberNo1.0Nucleus sampling probability (0-1), use either this or temperature
max_tokensintegerNo—Maximum number of tokens to generate
streambooleanNofalseWhether to enable SSE streaming output
stopstring/arrayNo—Stop sequence(s), generation stops when encountered
presence_penaltynumberNo0Presence penalty (-2.0 to 2.0)
frequency_penaltynumberNo0Frequency penalty (-2.0 to 2.0)
toolsarrayNo—Tool/function call definitions (supported by some models)
response_formatobjectNo—Response format, e.g. {"type": "json_object"} (supported by some models)

Message Roles in the messages Array#

RoleDescription
systemSystem instructions defining AI behavior and role
userUser input message
assistantAI's previous reply (for multi-turn conversations)

Error Codes and Error Responses#

Error Code Overview#

Status CodeTypeDescription
400BusinessErrorBusiness validation failed — e.g., missing required parameters, model doesn't support the request format
401GatewayErrorAuthentication failed — API Key is invalid, expired, or missing
503GatewayErrorService 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
}
FieldTypeAlways ReturnedDescription
codestringYesBusiness error code identifying the specific error type
messagestringYesDetailed error description explaining the cause
datanullNoBusiness 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"
  }
}
FieldTypeAlways ReturnedDescription
errorobjectYesError object details
error.codestringNoSystem error code, may be an empty string
error.messagestringYesSystem error description, usually includes request id for troubleshooting
error.typestringYesError 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
Next
Quick Start
Built with