Create a chat completion

OpenAI-compatible chat completions endpoint. Accepts the OpenAI chat completions request shape and routes to any catalogued model.

Also served at /v1/openai/chat/completions; both paths accept the same requests. This bare path matches the OpenAI SDK’s default base URL shape, so pointing the SDK at https://api-gateway.merge.dev/v1 works with no other changes.

Authentication

AuthorizationBearer
Your production key sent as a bearer token.

Request

This endpoint expects an object.
modelstringRequired
messageslist of objectsRequired
temperaturedouble or nullOptional
top_pdouble or nullOptional
ninteger or nullOptional
streambooleanOptionalDefaults to false
stopstring or list of strings or nullOptional
max_tokensinteger or nullOptional
max_completion_tokensinteger or nullOptional
presence_penaltydouble or nullOptional
frequency_penaltydouble or nullOptional
logit_biasmap from strings to doubles or nullOptional
userstring or nullOptional
toolslist of objects or nullOptional
tool_choicestring or map from strings to any or nullOptional
response_formatobject or nullOptional
OpenAI response format.
seedinteger or nullOptional
stream_optionsmap from strings to any or nullOptional
service_tierenum or nullOptional

Processing tier. ‘flex’ = discounted best-effort (slower, may be throttled); ‘priority’ = premium low-latency (not currently priced on any route, so it fails closed). Omit or ‘standard’ for normal processing. Allowed only on routes that price the requested tier, otherwise the request fails closed with 400.

service_tier_fallbackbooleanOptionalDefaults to false

If the provider throttles the requested tier (429/503), retry once at the standard tier, billed at standard rates. The response service_tier shows the tier that actually served.

Response

Successful Response

Errors

422
Unprocessable Entity Error