Browse documentation

API reference

Chat completions

POST /v1/chat/completions — the standard OpenAI body, streaming, and images.

POST /v1/chat/completions

The body is standard OpenAI JSON. model and messages are required; any other field the upstream model understands is passed through unchanged.

stream defaults to false#

Without streaming#

curl https://api.gamra.dev/v1/chat/completions \
  -H "Authorization: Bearer $GAMRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{ "role": "user", "content": "Explain millimes." }],
    "stream": false
  }'

With streaming#

Pass stream: true and the response arrives as text/event-stream in OpenAI's SSE format, terminated by data: [DONE].

const stream = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Explain millimes." }],
  stream: true,
});
 
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

The gateway forces stream_options.include_usage upstream, so the token counts arrive in the final event and billing is based on real consumption rather than an estimate.

Images#

A message carrying image_url parts is accepted only if the model reports vision: true in /v1/models. Otherwise the request is refused with a 400 and the code model_lacks_vision.

Available models#

GET /v1/models returns the catalogue filtered by your plan:

{
  "object": "list",
  "data": [
    {
      "id": "deepseek-v4-flash",
      "object": "model",
      "created": 0,
      "owned_by": "gamra",
      "min_tier": "free",
      "vision": false
    }
  ]
}