Chat Completions

View as Markdown

OpenAI-compatible chat completions endpoint.

Auth: Authorization: Bearer rsk_<ULID> Streaming: set stream=true for SSE chunks Templates: set template=“name” + variables={…} Rate limits: RPM and RPD enforced per key via Redis fixed-window counters Spend cap: enforced if key.spend_cap_usd is set (soft cap)

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
messageslist of objectsRequired
modelstring or nullOptionalDefaults to openai/gpt-4o
templatestring or nullOptional
variablesmap from strings to strings or nullOptional
session_idstring or nullOptional
streambooleanOptionalDefaults to false
temperaturedouble or nullOptional0-2
max_tokensinteger or nullOptional>=1
top_pdouble or nullOptional0-1
frequency_penaltydouble or nullOptional-2-2
presence_penaltydouble or nullOptional-2-2
stopstring or list of strings or nullOptional
seedinteger or nullOptional
toolslist of objects or nullOptional
tool_choicestring or map from strings to any or nullOptional
response_formatmap from strings to any or nullOptional
transformslist of strings or nullOptional
modelslist of strings or nullOptional
userstring or nullOptional<=256 characters
modalityenum or nullOptional
imageobject or nullOptional
async_modebooleanOptionalDefaults to false
modalitieslist of enums or nullOptional
audioobject or nullOptional
timeoutdouble or nullOptional

Response

Successful Response