Docs / API reference / Chat completions

Chat completions

The standard OpenAI Chat Completions schema, on the /oss lane.

posthttps://api.opengateway.one/oss/v1/chat/completions

Set model to any curated /oss id — a friendly alias like claude-sonnet-4-7 or a raw id with a routing suffix (:fastest, :cheapest, :preferred).

Request

curl
curl https://api.opengateway.one/oss/v1/chat/completions \
  -H "Authorization: Bearer $OPENGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-ai/DeepSeek-V4-Pro:fastest",
    "messages": [{ "role": "user", "content": "Hello" }],
    "stream": false
  }'

Response

json
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "deepseek-ai/DeepSeek-V4-Pro",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello! How can I help?" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 9, "completion_tokens": 7, "total_tokens": 16 }
}

Common parameters

FieldTypeNotes
modelstringRequired. Alias or org/model[:policy].
messagesarrayRequired. Standard role/content turns.
streambooleanServer-sent events when true.
toolsarrayFunction/tool calling on capable models.
reasoning_effortstringNormalized effort — see Effort levels.
max_tokensintegerClamped to the resolved model's window.

Streaming

curl · stream
curl https://api.opengateway.one/oss/v1/chat/completions \
  -H "Authorization: Bearer $OPENGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "claude-sonnet-4-7", "stream": true,
        "messages": [{ "role": "user", "content": "Stream a haiku." }] }'

Responses arrive as standard OpenAI chat.completion.chunk SSE events terminated by data: [DONE].

See Models for discovery and Quickstart for SDK setup.