OpenAI Chat Completions

OpenAI Chat Completions

The OpenAI protocol is OctaRouter's universal entry point — almost every model on the gateway can be called through POST /v1/chat/completions, even when the upstream vendor is not OpenAI. Use your existing OpenAI SDK or HTTP client with OctaRouter as the base URL.

Authentication

Authorization: Bearer YOUR_API_KEY

Example

curl "$GATEWAY_URL/v1/chat/completions" \
  -H "Authorization: Bearer sk-or-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "system", "content": "You are helpful."},
      {"role": "user", "content": "Summarize OctaRouter in one sentence."}
    ],
    "stream": false
  }'

Streaming

Set "stream": true to receive Server-Sent Events in OpenAI format.

Models

List available model IDs on the Models page or via GET /v1/models on the proxy. For Claude or Gemini, you may prefer the native Anthropic or Gemini routes when your client supports them.