Documentation

API reference
POST/v1/chat/completions

Create Chat Completion

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

ProtocolOpenAI Chat Completions
Reference categoryChat

Compatible model examples

gpt-4ogpt-4.1gpt-5o3o4-mini
Keep the format. Choose your model.
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
}'
Example only · no request is sent
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.
Your applicationRouteKeyOpenAI

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.