Skip to main content
POST
Proxy a chat completion request with automatic paywall enforcement

Authorizations

Authorization
string
header
required

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

Headers

X-Paywall-User
string

Optional user identifier provided by the developer. Can be used instead of the user property in the request body to associate the API call with a specific end user.

Body

application/json
model
string
required

The model to use for generating the response.

messages
object[]
required

A list of messages that make up the conversation.

Minimum array length: 1
user
string

The unique identifier of the user making the request.

stream
boolean
default:false

Whether to stream the response back to the client.

Response

200 - application/json

successful operation

id
string

The completion identifier.

Example:

"chatcmpl-123"

object
string

The type of the returned object.

Example:

"chat.completion"

created
integer

The creation timestamp of the completion.

Example:

1677652288

choices
object[]

The list of choices returned by the model.