Skip to main content
POST
Create a chat completion (legacy path)

Authorizations

Authorization
string
header
required

Use an API key created in the NinjaChat developer console.

Headers

Idempotency-Key
string

Safely retry the same logical write without duplicate billing or execution.

Required string length: 1 - 255

Body

application/json

The body is of type object.

Response

Chat completion or SSE stream.

id
string
required
object
enum<string>
required
Available options:
chat.completion
created
integer
required
model
string
required
Required string length: 1 - 160
resolved_model
string
required
Required string length: 1 - 160
provider
string | null
required
choices
object[]
required
usage
object
required
cost_usd
number
required
Required range: x >= 0
request_id
string
required
routing
object
required
cost
object
balance
string
metadata
object