Skip to content

API & reference

Completions

POST
/v1/completions
curl --request POST \
--url http://localhost:8000/v1/completions \
--header 'Content-Type: application/json' \
--data '{}'

The legacy completions API: each prompt runs the chat path as one user message (_serve), with the same checks, task resolution, cascade, quota and storage as /v1/chat/completions; n, stream, stop, max_tokens and the rest are the chat fields of the same name. A batch of prompts needs that many requests of the daily quota, checked before the first runs; a batch that stops after its first prompt is an error that names the prompts already answered and carries X-Should-Retry: false (_batch_stopped). A suffix, echo or best_of that would change the answer, and token-array prompts, are a 400.

x-ratchet-task
Any of:
string
x-api-key
Any of:
string
api-key
Any of:
string
Media typeapplication/json
object

Example generated

{}

Successful Response

Media typeapplication/json

Example generated

example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}