My code already speaks the OpenAI API format — what actually breaks when I swap the provider?
4 min read
The short answer is that the wire format carries across intact, and the fields sitting on top of it are where the surprises hide. SentX's API runs the OpenAI Chat Completions request and response format at https://api.sentx.ai/v3, and its own documentation scopes the claim exactly: compatibility with every client or every OpenAI endpoint is not implied. That is a format statement, not a drop-in guarantee. So the useful pre-swap move is to split your integration into two layers — the parts that transfer unchanged because they are the format, and the parts you verify with your own eyes before production traffic points at the new base URL.
Source: API Documentation v3.5 - SentX; OpenAI-Compatible API: sentx-3 at USD 3 per 1M | SentX SI
What transfers unchanged
If your code already builds valid Chat Completions payloads, the transport layer is the same. The path is /chat/completions under the new base URL. The request body keeps its shape: a messages array, a model field, sampling parameters. Streaming stays standard server-sent events — data: {chunk}\n\n frames terminated by data: [DONE]\n\n — and answer text arrives only in delta.content, a placement the SentX docs say never changes. Error responses keep the OpenAI-style envelope, so a client that reads HTTP status plus error.type keeps working. If you set stream_options.include_usage, the final usage chunk with prompt_tokens, completion_tokens and total_tokens is still there, with choices empty on that chunk.
Source: API Documentation v3.5 - SentX
One structural habit worth confirming: the API is stateless. The full conversation goes with every request, exactly as with the standard endpoint, and a stable X-Session-Id header is what keeps session state per conversation thread.
Source: OpenAI-Compatible API: sentx-3 at USD 3 per 1M | SentX SI
What to verify before you switch
Model identifier. Send sentx-3. Other model strings are accepted for client compatibility, but the documented name is the one to use.
Source: OpenAI-Compatible API: sentx-3 at USD 3 per 1M | SentX SI
Streamed delta keys. SentX adds extra keys on the same delta object: delta.act for an activity timeline, delta.search_sources for the web sources it read, delta.queue_position while a request waits in a saturated window, and delta.artifact for product-authorized media output. Unknown keys are safe to ignore, and they are on by default on /v3 — a client that cannot tolerate them sends the header X-Progress-Stream: 0. One parsing habit matters: if you read choices[0] unconditionally on every chunk, the usage chunk (choices: []) will fault.
Source: API Documentation v3.5 - SentX
Tool and function-call payloads. Only type "function" is supported. Each tool entry is capped at 64 KiB and the sum at 512 KiB, measured as compact JSON with non-ASCII characters escaped; tool schemas also count toward the 500,000-token context ceiling, of which required input must fit 467,232. A completed call lands in choices[0].message.tool_calls with finish_reason "tool_calls"; when streaming, fragments arrive in delta.tool_calls and you group them by index before executing anything.
Source: API Documentation v3.5 - SentX
Output limit. The current parameter is max_completion_tokens; max_tokens is a legacy alias, and when both are present the new one wins.
Source: API Documentation v3.5 - SentX
Rate limits and headers. 150 requests per rolling 60 seconds and 34 concurrent streams per key, 25 active keys per account. Exceeding a limit returns 429 with code rate_limit_exceeded — never a partial answer, which is what makes retry safe. Responses carry X-RateLimit-Limit-Requests, X-RateLimit-Remaining-Requests and X-RateLimit-Reset-Requests.
Source: API Documentation v3.5 - SentX
Error-code set. Alongside the expected 400, 401, 402, 413, 422 and 429, there is one provider-specific case: HTTP 503 with error.type "sleeping," meaning the assistant is resting and you retry later. Two framing rules from the docs are worth encoding regardless of provider: an HTTP 200 alone does not prove success, and a stream that ends without [DONE] should be treated as incomplete.
Source: API Documentation v3.5 - SentX
Billing fields. Sending X-Include-Cost: 1 returns cost_cents_exact and billing_policy on the usage object, which is how you check per-call spend rather than trusting a rate table.
Source: API Documentation v3.5 - SentX
One documented gap to flag: the api-docs page states there is no per-request minimum charge, while the openai-compatible-api page and the pricing page both list a $0.01 minimum per request. Those statements do not agree, so treat the floor as an open question and confirm live behavior with X-Include-Cost: 1 on a few small calls before it matters to a billing forecast.
Source: API Documentation v3.5 - SentX; OpenAI-Compatible API: sentx-3 at USD 3 per 1M | SentX SI
A three-call smoke test
This is an editorial suggestion rather than a documented procedure, but it covers the three failure classes above in one pass against the new base URL. First, a streamed call, checking that delta.content accumulates, unknown delta keys pass through without throwing, and the final usage chunk parses despite empty choices. Second, a tool-calling call, checking that delta.tool_calls fragments reassemble, finish_reason comes back as "tool_calls," and your round-trip of the tool result returns a final answer. Third, a deliberately over-limit call — a huge output request or a burst past the 429 threshold — checking that the error envelope parses in your client and that your retry logic honors Retry-After. Three calls, a handful of minutes, and the swap stops being a guess.
The honest summary: point your existing client at the new URL and most of it works, which is the point of format compatibility. What breaks is not the protocol but the fields the provider chose to add and the numbers it chose to set — and a verification list is what turns "the spec says compatible" into "my integration actually survives."
Sources
- API Documentation v3.5 - SentX — SentX SI
Supported claims and limits
- Paid HTTP API in the OpenAI Chat Completions request and response format at base URL https://api.sentx.ai/v3, model sentx-3
- Compatibility with every client or every OpenAI endpoint is not implied
- Streaming arrives as SSE data:{chunk} frames terminated by data:[DONE]; answer text arrives only in delta.content, a placement that never changes; on /v3 progress events are on by default and X-Progress-Stream: 0 disables them
- Extra delta keys delta.act, delta.search_sources, delta.queue_position, delta.artifact; unknown keys are safe to ignore; the include_usage chunk carries choices:[]
- Caller tools: only type function; 64 KiB per tool entry, 512 KiB sum as compact JSON with non-ASCII escaped; tool schemas count toward the 500,000-token context (467,232 required-input ceiling); completed calls land in choices[0].message.tool_calls with finish_reason tool_calls; streaming fragments arrive in delta.tool_calls and group by index
- Output limit: max_completion_tokens is current, max_tokens is a legacy alias, and the new name wins when both are present
- Rate limits: 150 requests per rolling 60 seconds and 34 concurrent streams per key, 25 active keys per account; exceeding returns 429 rate_limit_exceeded; responses carry X-RateLimit-Limit-Requests, X-RateLimit-Remaining-Requests, X-RateLimit-Reset-Requests; honor Retry-After
- Errors use the OpenAI-style envelope; 503 with type sleeping means Victoria is sleeping, retry later; after streaming starts errors can arrive as a data:{"error":...} frame then [DONE]; HTTP 200 alone does not prove success and a disconnect without [DONE] is incomplete; the doc's status map covers 400, 401, 402, 413, 422, 429
- X-Include-Cost: 1 returns usage.cost_cents_exact and billing_policy; the api-docs state there is no per-request minimum
- Stable X-Session-Id keeps session state per conversation thread
- OpenAI-Compatible API: sentx-3 at USD 3 per 1M | SentX SI — SentX SI
Supported claims and limits
- Same paths, request bodies, streaming events and error shapes as the OpenAI Chat Completions format, with one model name, sentx-3
- Compatibility means format compatibility, not feature parity; every client or every OpenAI endpoint is not implied
- The API is stateless: send the full conversation with each request
- That page and the pricing page list a minimum charge of 1 cent per request, which contradicts the api-docs' no-minimum statement