Theme
Language

Chat Completions

/v1/chat/completions — the OpenAI-compatible chat endpoint. model, messages, stream, temperature params. SSE streaming. Request and response examples in curl, Python (openai) and Node.

The OpenAI-compatible chat endpoint. Works with any OpenAI SDK — just change base_url to https://getvibeapi.com/v1.

POSThttps://getvibeapi.com/v1/chat/completions

Request body parameters

GetVibe implements a compatible Chat Completions contract, not a byte-for-byte passthrough: it checks access, resolves the public model id, applies limits and may normalize supported request fields. Responses and errors are also normalized and do not guarantee upstream-specific fields or headers. For most tasks the first three — model, messages and stream — are enough.

Basic — work on all models
ParameterTypeDescription
modelreq.stringA model name from the catalog, for example gpt-6.1-sol or claude-opus-5.5.
messagesreq.arrayArray of messages { role, content }. Roles: system, user, assistant.
streambooleantrue — stream the response over SSE.
max_tokensintegerMaximum tokens in the response. We recommend at least 64: with too small a value (for example ≤ 16) the model may hit the limit (finish_reason: length) before the first visible token and return an empty response. If you need a short result — ask for it in the prompt, and keep max_tokens with headroom.
temperaturenumberOutput randomness, 0–2. Default 1.
Advanced — support depends on the model
ParameterTypeDescription
top_pnumbermodel-dependentNucleus sampling (0–1). Alternative to temperature; changing both at once is not recommended.
top_knumberClaudeTop-K sampling. Anthropic models only.
seedintegerGPTPins the result for reproducibility. GPT series; ignored elsewhere.
stopstring | arraymodel-dependentStop sequence: one string or a list of up to 4 strings.
frequency_penaltynumberGPT · ClaudePenalty for repeating tokens by frequency (-2 to 2).
presence_penaltynumberGPT · ClaudePenalty for tokens already seen (-2 to 2).
logprobsboolean—No current route returns log-probabilities: the parameter is removed before dispatch and reported in the x-getvibe-warnings header (param_dropped:logprobs); the request is not refused.
top_logprobsinteger—Removed together with logprobs and reported in x-getvibe-warnings.
logit_biasobjectGPTToken-ID → logit bias (-100 to 100).
userstringmodel-dependentEnd-user identifier (passed upstream for rate-limit tracking).
response_formatobjectGPT · ClaudeForce the output to JSON. Learn more →
tools / tool_choicearray / stringGPT · ClaudeFunction calling. Learn more →

Badges in the “Support” column: GPT — GPT series only, Claude — Anthropic models only, GPT · Claude — both families, model-dependent — check that model’s docs.

Parameter support by route variant

The same model can be served by different routes (variants :1, :2, …). Routes differ in price, speed and the set of supported parameters.

Comparing route variants
ParameterTypeDescription
Default variant (:1)basicFull OpenAI parameter set: temperature, top_p, seed, stop, penalties, logprobs, tools, response_format, streaming with a usage chunk.
Subscription variants (:2, :3…)advancedThe parameter set matches the basic one, but the route uses different infrastructure. Individual parameters may be unsupported — we note that in the variant description.
or-* variantsor-*Proxies the request through a separate aggregator. Parameter support depends on the specific provider. tool_choice: "required" and some sampling parameters may not work.
An unknown parameter is ignored by the provider or returns a 400. If a parameter matters — use the :1 (default) variant or check support in the variant description on the Models page.

Example request

curl https://getvibeapi.com/v1/chat/completions \
  -H "Authorization: Bearer $GETVIBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-sol",
    "messages": [
      {"role": "user", "content": "Hello! Who are you?"}
    ]
  }'

Example response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "gpt-6.1-sol",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hi! I'm an assistant available through GetVibe API."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 14,
    "total_tokens": 26
  }
}

Streaming (SSE)

With "stream": true the response comes as a stream of Server-Sent Events: data: … events with deltas, ending with data: [DONE].

curl https://getvibeapi.com/v1/chat/completions \
  -H "Authorization: Bearer $GETVIBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-sol",
    "stream": true,
    "messages": [{"role": "user", "content": "Count to three"}]
  }'

Final chunk with usage

The last chunk before data: [DONE] has empty choices: [] and a usage field with token stats. Use it for billing — do not sum the deltas by hand.

data: {"id":"chatcmpl-...","choices":[],"usage":{"prompt_tokens":42,"completion_tokens":87,"total_tokens":129},"model":"gpt-6.1-sol","object":"chat.completion.chunk"}

data: [DONE]

Every non-stream response whose cost can be estimated includes the x-pv-cost-rub response header. Streaming bodies contain no pv_cost_rub by default; send x-pv-cost: 1 to add the cost to that protocol's final usage event. This is a best-effort estimate; for the actual debit, see the request history GET /v1/generations.

Compatibility

The endpoint is compatible with the OpenAI SDKs (Python, Node and more), Codex CLI and Claude Code. Claude Code works through /v1/messages with the x-api-key header — see Messages and Responses.

Chat Completions API GetVibe — Python and curl examples | GetVibe API