Skip to main content
POST
Create a text completion (legacy)

Authorizations

Authorization
string
header
default:YOUR_API_KEY
required

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

Body

application/json
model
string
required
Example:

"glm-5.3-abliterated"

prompt
required

String or string array (joined with newline).

max_tokens
integer

When omitted: the model's max output, else its context window minus the prompt.

stream
boolean
default:false

Response

Text completion

id
string
required
object
string
required
Example:

"text_completion"

created
integer
required
model
string
required
choices
object[]
required
usage
object
required