AI Gateway · API reference
Docs / AI Gateway

API reference

The OpenAI-compatible chat completions endpoint — identical request and response shape regardless of upstream provider.

The gateway exposes an OpenAI Chat Completions endpoint. Send the standard OpenAI body; the response comes back in OpenAI shape even when the upstream is Anthropic.

Base: https://api.cloud.nevtan.com/api/v1
POST/gateway/v1/chat/completionsRoute a chat request to the hosted provider named in `model`.

Parameters

ParameterTypeDescription
modelrequiredstringA provider/model id from the catalog, e.g. anthropic/claude-sonnet-5.
messagesrequiredarrayConversation as {role, content} objects (system, user, assistant).
max_tokensintegerMax tokens to generate. Required by Anthropic models; defaulted when omitted.
temperaturenumberSampling temperature, 0–2.

Example

bash
 

The response is a standard OpenAI chat.completion object with choices[0].message.content and a usage block (prompt_tokens, completion_tokens, total_tokens).

Errors
A missing BYOK key returns 402 with a message pointing you to Bring Your Own Key. Upstream provider errors are surfaced as 502 with the provider’s own error text. See Errors.