Choosing Chat Completions or the Responses endpoint on SiberAI
This article was prepared by the SiberAI team.
SiberAI exposes more than one production-shaped path under the same OpenAI-compatible base URL. Teams often copy a Chat Completions snippet and later discover a Responses-style client that expects an input field instead of messages. Both are valid on SiberAI when configured correctly; they are not interchangeable request bodies.
Shared gateway facts
All customer calls go to the /api/siberai/v1 root on siberai.net with a Bearer sai_ide_ key and model id siber-v3 (quickstart, authentication). The gateway lists GET /models, POST /chat/completions and POST /responses on that root. Listing a model does not waive balance checks.
Chat Completions in brief
The chat-completions POST route expects a non-empty messages array, optional stream, and max_tokens in 1–8192 (default 4096 when omitted) as documented on the chat page. Extra SDK fields are not a promise of every upstream product behaviour.
Responses: input-based contract
/responses POST uses an input-based contract. The input field accepts text or an array. The gateway uses max_output_tokens (1–8192; default 4096) and sets store to false. The same roughly 2 MiB JSON body limit applies (Responses).
{
"model": "siber-v3",
"input": "Draft a regression test plan for this change.",
"max_output_tokens": 1024,
"stream": false
}
Compatibility boundary
The Responses docs state clearly that the endpoint does not claim every external Responses product feature. Hosted tools, a server-side durable response store, and image/embedding endpoints are outside this contract. Validate your client against the events and fields you actually receive.
Practical selection guide
- Existing chat SDK loops with roles → prefer Chat Completions.
- Newer clients that send
input/max_output_tokens→ Responses. - Do not mix fields across endpoints and expect silent translation.
- Cap output to shrink pre-call reservation impact (billing).
- On interrupt or unclear usage, check the panel before blind retry (errors).
Wire secrets through environment variables, not source (environment). Product home: SiberAI.
Picking the wrong shape usually looks like a 400-class validation problem, not a “dumb model.” Fix the contract first, then tune prompts.
Migration checklist between shapes
When moving a service from Chat Completions to Responses—or the reverse—change one environment at a time. Keep the staging key separate. Compare a single golden prompt on both paths and record which field names your SDK emits. If the SDK offers a “compatibility” helper, still verify the wire JSON against SiberAI’s docs rather than assuming parity with another vendor’s Responses product.
Document for your team: which internal services are chat-shaped, which are input-shaped, and who owns the next contract change. That ownership map prevents weekend pages where two clients disagree about max_tokens versus max_output_tokens.
FAQ
Q: Can I send messages to /responses?
A: The Responses path expects input, not the Chat Completions messages field.
Q: Does Responses keep a hosted store of outputs?
A: The gateway sets store to false; durable hosted storage is outside the documented contract.
Q: Same model id on both?
A: Yes—use siber-v3 on both documented production paths.
When teams still pick Chat Completions
Many IDEs and proxy libraries still ship Chat Completions first. SiberAI keeps that surface so those clients need only a base URL and key change. Prefer Responses when you control both ends of the call and want one documented place for tools and structured output. Prefer Chat Completions when a third-party plugin hard-codes that path. Mixing both in one product is fine: keys, model id, and billing rules stay the same.
Practical migration notes
Point the OpenAI-compatible client at base path /api/siberai/v1 on siberai.net, set the model to siber-v3, and keep the Bearer sai_ide_ secret out of source control. If a Responses call fails after a Chat Completions success with the same key, compare the JSON body shape against the Responses docs rather than rotating the key first. Gateway 4xx messages usually name the field that failed validation. For streaming, confirm the client accepts SSE the same way on both routes before blaming the network.
Output handling differences
On Chat Completions, synchronous clients read choices and usage when present. Network chunk boundaries are not JSON event boundaries; your SSE parser must reassemble events. The chat page notes that accepting extra SDK fields does not guarantee every model behaviour, and unexpected fields are not forwarded to the internal service. Tool loops stay client-owned: the service does not automatically execute your functions.
On Responses, confirm the events your client actually consumes. Hosted tools and persistent server-side response storage are outside the documented contract. Cap max_output_tokens deliberately—billing reserves against the output ceiling before the call runs.
Sources
- https://siberai.net/en/docs/chat-completions
- https://siberai.net/en/docs/responses
- https://siberai.net/en/docs/gateway
Disclosure: Independent overview of SiberAI (siberai.net) public documentation; not an official SiberAI publication.
Yorumlar
Yorum Gönder