Skip to main content
POST
Chat Completions

Authorizations

Authorization
string
header
required

Pass an API key (prefixed lk_) or a JWT access token as a bearer token. Generate API keys in the dashboard at https://dashboard.lyceum.technology/api-keys.

Body

application/json

OpenAI-compatible chat completion request. Any additional OpenAI parameter is forwarded to the model unchanged.

model
string
required

Model ID from GET /serverless/models. Virtual routing models are also accepted: lyceum/simple, lyceum/complex, lyceum/reasoning, lyceum/router (auto-selects). Slash-free aliases (e.g. z-ai-glm-5.2) work for clients that reject /.

messages
object[]
required
Minimum array length: 1
stream
boolean
default:false

If true, tokens are streamed as Server-Sent Events (text/event-stream).

max_tokens
integer

Maximum tokens to generate.

temperature
number
top_p
number
stop
presence_penalty
number
frequency_penalty
number
tools
object[]
tool_choice
reasoning_effort
enum<string>

Toggle/scale reasoning on models that support it. none disables thinking.

Available options:
none,
low,
medium,
high
stream_options
object

Response

200 - application/json

Successful Response

OpenAI-compatible chat completion. For stream: true, the response is a text/event-stream of chat.completion.chunk events terminated by data: [DONE].

id
string
object
string
Example:

"chat.completion"

created
integer
model
string
choices
object[]
usage
object