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 category채팅

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
파라미터
Name유형필수Description
modelstring예모델 이름
messagesarray<object>예채팅
temperaturenumber아니요Temperature
top_pnumber아니요Top P
streamboolean아니요실시간
max_tokensinteger아니요Max tokens
toolsarray<object>아니요Tools
response_formatobject아니요Response format
응답
Name유형필수Description
idstring-ID
objectstring-Object
createdinteger-Created
modelstring-모델 이름
choicesarray<object>-Choices
usageobject-Usage
참고
  • OpenAI Chat Completions
  • Use the same request shape as the matching provider API when the backend channel is enabled.
Your applicationRouteKeyOpenAI

핵심 개념

핵심 개념

API 키: API 키

Base URL: Route Key는 OpenAI 형식을 유지하고 SDK의 대상만 바꿉니다.

모델 이름: 모델 이름은 payload에 유지되며 백엔드가 라우팅을 결정합니다.

사용량 및 결제: 비용, 토큰, 지연 시간은 사용 로그에 표시됩니다.

모델 선택

모델 선택

일반 채팅: 일반 채팅

추론 또는 코드: 추론 또는 코드

추론 또는 코드

사용량 및 결제

일반 오류

첫 실패는 인증, 모델 이름, 쿼터 또는 요청 형식 때문인 경우가 많습니다.

401

인증

인증

403

사용량 및 결제

모델 이름은 payload에 유지되며 백엔드가 라우팅을 결정합니다.

429

사용량 및 결제

비용, 토큰, 지연 시간은 사용 로그에 표시됩니다.

5xx

일반 오류

첫 실패는 인증, 모델 이름, 쿼터 또는 요청 형식 때문인 경우가 많습니다.