Tai lieu

Ket noi mot lan, dinh tuyen moi mo hinh.

Dung Route Key voi dinh dang tuong thich OpenAI, Anthropic, Gemini, Qwen, DeepSeek, Grok va MiniMax.

Che do demo5 mo hinh da lap chi mucDa cap nhat 00:00:00
30endpoint API mo hinh
8nhom nha cung cap
API keyXac thuc
Integration guideConnect apps and coding agentsOne API key and compatible gateway for SDKs, Codex, Claude Code, Gemini CLI, and Cursor.Open guide
POSTOpenAI/chat/completions

Create Chat Completion

Creates a model response from conversation history with streaming, tools, and usage accounting.

Authorization
Add this value to the HTTP request headers.
Authorization: Bearer sk-your-key
Content-Type

application/json

model

gpt-4o, gpt-4.1, gpt-5, o3, o4-mini

Vi du yeu cau
curl -X POST https://api.routekey.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": "Hello from Route Key"
    }
  ],
  "stream": false
}'
Vi du phan hoi
{
  "id": "chatcmpl_xxx",
  "object": "chat.completion",
  "created": 0,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello!"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 3,
    "total_tokens": 11
  }
}
Vi du cURL
curl -X POST 'https://api.routekey.ai/v1/chat/completions' \
  -H 'Authorization: Bearer sk-your-key'
  -H 'Content-Type: application/json'
  -d '{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": "Hello from Route Key"
    }
  ],
  "stream": false
}'
Tham so
NameKieuBat buocDescription
modelstringCoTen mo hinh
messagesarray<object>CoChat
temperaturenumberKhongTemperature
top_pnumberKhongTop P
streambooleanKhongThoi gian thuc
max_tokensintegerKhongMax tokens
toolsarray<object>KhongTools
response_formatobjectKhongResponse format
Phan hoi
NameKieuBat buocDescription
idstring-ID
objectstring-Object
createdinteger-Created
modelstring-Ten mo hinh
choicesarray<object>-Choices
usageobject-Usage
Ghi chu
  • OpenAI Chat Completions
  • Use the same request shape as the matching provider API when the backend channel is enabled.

Khai niem cot loi

Khai niem cot loi

API key: API key

Base URL: Route Key giu dinh dang OpenAI va chi doi noi SDK gui traffic.

Ten mo hinh: Ten mo hinh giu trong payload va backend quyet dinh dinh tuyen.

Su dung va thanh toan: Chi phi, token va do tre hien trong log.

Chon mo hinh

Chon mo hinh

Chat thong thuong: Chat thong thuong

Suy luan hoac code: Suy luan hoac code

Suy luan hoac code

Su dung va thanh toan

Loi thuong gap

Loi lan dau thuong do xac thuc, mo hinh, quota hoac dang yeu cau.

401

Xac thuc

Xac thuc

403

Su dung va thanh toan

Ten mo hinh giu trong payload va backend quyet dinh dinh tuyen.

429

Su dung va thanh toan

Chi phi, token va do tre hien trong log.

5xx

Loi thuong gap

Loi lan dau thuong do xac thuc, mo hinh, quota hoac dang yeu cau.