base_url to https://api.hostlinku.com/v1.
x-request-id header (Hostlinku request ID) and, for successful non-streaming responses, the x-model header (the public slug of the model that served the request).
Body Parameters
Example: Non-streaming request (curl)
model field always contains the Hostlinku public slug (not the internal ID), and the additional hostlinku block is always present in a successful response, containing only the cost and latency of the request:
Streaming (stream: true)
With stream: true, the gateway responds with Content-Type: text/event-stream (SSE), streams chunks in an OpenAI-compatible format (each chunk uses a public Hostlinku id and the same model slug), and then closes the stream with data: [DONE]:
- If a failure occurs during the stream, the gateway sends a single error event
(
data: {"error": { "code": …, "message": … }}) and does not send a fake[DONE]. A disconnected stream never looks like a stream that has completed normally. - Fixed costs are calculated based on actual usage after the stream ends; if usage data is not available, The invoice uses the estimate that was reserved when the request was received.
- The
x-request-idheader is also sent in streaming responses to correlate with logs in console.
Example: Python (Official OpenAI SDK)
There are no code changes other thanbase_url. The OpenAI SDK is ready to use:
Common errors on this endpoint
The complete format of the error envelope is available at Error.

