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.
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.
| Parameter | Type | Description |
|---|---|---|
modelreq. | string | A model name from the catalog, for example gpt-6.1-sol or claude-opus-5.5. |
messagesreq. | array | Array of messages { role, content }. Roles: system, user, assistant. |
stream | boolean | true — stream the response over SSE. |
max_tokens | integer | Maximum 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. |
temperature | number | Output randomness, 0–2. Default 1. |
| Parameter | Type | Description |
|---|---|---|
top_p | numbermodel-dependent | Nucleus sampling (0–1). Alternative to temperature; changing both at once is not recommended. |
top_k | numberClaude | Top-K sampling. Anthropic models only. |
seed | integerGPT | Pins the result for reproducibility. GPT series; ignored elsewhere. |
stop | string | arraymodel-dependent | Stop sequence: one string or a list of up to 4 strings. |
frequency_penalty | numberGPT · Claude | Penalty for repeating tokens by frequency (-2 to 2). |
presence_penalty | numberGPT · Claude | Penalty for tokens already seen (-2 to 2). |
logprobs | boolean— | 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_logprobs | integer— | Removed together with logprobs and reported in x-getvibe-warnings. |
logit_bias | objectGPT | Token-ID → logit bias (-100 to 100). |
user | stringmodel-dependent | End-user identifier (passed upstream for rate-limit tracking). |
response_format | objectGPT · Claude | Force the output to JSON. Learn more → |
tools / tool_choice | array / stringGPT · Claude | Function 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.
| Parameter | Type | Description |
|---|---|---|
Default variant (:1) | basic | Full OpenAI parameter set: temperature, top_p, seed, stop, penalties, logprobs, tools, response_format, streaming with a usage chunk. |
Subscription variants (:2, :3…) | advanced | The 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-* variants | or-* | Proxies the request through a separate aggregator. Parameter support depends on the specific provider. tool_choice: "required" and some sampling parameters may not work. |
: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.