메인 콘텐츠로 건너뛰기
POST
/
chat
/
completions
curl --request POST \
  --url https://api.orcarouter.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "Say hi in one word."
    }
  ],
  "max_tokens": 10
}
'
{
  "id": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "content": "<string>",
        "name": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "tool_call_id": "<string>"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

인증

Authorization
string
header
필수

OrcaRouter API 키는 sk-orca-...처럼 보입니다. Authorization: Bearer sk-orca-... 헤더로 전달하세요.

본문

application/json
model
string
필수

모델 ID. 세 가지 형태 지원:

  • 프로바이더 접두사(기본): openai/gpt-4o-mini, anthropic/claude-sonnet-4.6, google/gemini-2.5-flash
  • 일반 별칭: gpt-4o-mini(베어 이름 별칭이 사용 가능할 때)
  • 이름 지정 라우터: orcarouter/{name}(요청 시간에 모델로 해결; orcarouter/auto는 모든 계정의 가입 시 시드되어 가장 저렴한 라이브 채팅 모델을 선택)
예시:

"gpt-4o"

"openai/gpt-4o"

"orcarouter/auto"

messages
object[]
필수
stream
boolean

true일 때, 응답이 server-sent events로 스트리밍됨.

stream_options
object

stream: true일 때만 적용.

tools
object[]
tool_choice
사용 가능한 옵션:
auto,
none,
required
parallel_tool_calls
boolean
기본값:true
response_format
Text (default) · object
temperature
number
필수 범위: 0 <= x <= 2
top_p
number
필수 범위: 0 <= x <= 1
max_tokens
integer
필수 범위: x >= 1
max_completion_tokens
integer

추론 모델에서 max_tokens보다 선호됨.

n
integer
기본값:1
필수 범위: x >= 1
stop
seed
integer

결정론적 샘플링용.

logprobs
boolean
top_logprobs
integer
필수 범위: 0 <= x <= 20
presence_penalty
number
필수 범위: -2 <= x <= 2
frequency_penalty
number
필수 범위: -2 <= x <= 2
logit_bias
object
user
string
reasoning_effort
enum<string>

OpenAI 추론 모델용(o1, o3*, o4*, gpt-5*-pro 등). Anthropic Claude는 대신 thinking 필드를 사용; Gemini는 프로바이더 고유 구성을 사용.

사용 가능한 옵션:
low,
medium,
high
web_search_options
object

Chat Completions 요청에서 웹 검색 활성화. Responses API는 대신 tools: [{"type": "web_search"}]를 사용. OpenAI 검색 미리보기 모델, 현대 web_search 도구를 받는 OpenAI 모델, Anthropic 모델(Anthropic의 네이티브 web_search 서버 도구로 변환)에서 인식됨.

web_search_options가 충분히 표현적이지 않을 때 업스트림의 web-search 도구로 전달되는 자유 형식 원시 페이로드. 대부분의 사용자는 web_search_options를 선호해야 합니다.

extra_body
object

OrcaRouter 고유 요청 확장. chat completion 요청의 최상위 extra_body 키 아래에 두세요.

응답

완성 성공. 스트리밍 응답은 SSE(text/event-stream)를 사용.

id
string
object
enum<string>
사용 가능한 옵션:
chat.completion
created
integer
model
string
choices
object[]
usage
object