Try it
Enter a key and pick a model to send a real request from this page. It runs the same auth, credit and model checks as any client, so a green result means your key is valid, your org has credit, and the model ID resolves.This sends one real chat completion and bills it to your org, the same as any other request. It is a few tokens.
Endpoint and authentication
The base URL for serverless inference is:lk_...) as a Bearer token. Most SDKs append the path for you, so you pass only the base URL above.
Smart Routing is not part of the OpenAI-compatible surface and keeps its own absolute URL:
POST https://api.lyceum.technology/api/v2/external/serverless/route — see Smart Routing.There is no legacy text
/completions endpoint. All text generation goes through /chat/completions using the messages format.Quickstart
- Python
- curl
Streaming
Setstream: true to receive tokens as they are generated. This is the recommended mode for anything user-facing or long-form, it lowers time-to-first-token and keeps the connection active for the full generation.
Timeouts and long-running requests
The platform allows a single request up to 300 seconds of generation time. Large context windows or long outputs on a non-streaming call can genuinely take minutes, so the most common source of “cut off” errors is a client-side timeout that fires before the response finishes, not the server. If you must run non-streaming for long generations, raise your client’s read timeout:Function calling and tools
All chat models support function / tool calling using the standard OpenAItools and tool_choice parameters.
A small number of models prefer to answer in text rather than call a tool when
tool_choice is left on "auto". If you find a model returning prose instead of a tool call, set tool_choice="required" to force it.Prompt caching
Prompt caching is automatic, there is nothing to enable. When consecutive requests share an identical leading prefix (for example a fixed system prompt or a large shared context), the cached portion is reused and billed at a reduced input rate. To benefit, keep the stable part of your prompt at the front and vary only the tail (the user’s latest message). Caching is best-effort, a request may or may not hit a warm cache depending on recent traffic. Cache hits are reported in the usage object:prompt_tokens_details is absent entirely on a cache miss rather than reporting zero, so read it defensively:Reasoning models
Several serverless models produce an explicit reasoning trace before the final answer. The trace is returned inreasoning_content and counts toward output tokens, so set max_tokens high enough to cover both the reasoning and the visible answer. Otherwise the whole budget can be spent on reasoning and content comes back empty or truncated.
Controlling reasoning
Reasoning is toggled throughchat_template_kwargs, which Lyceum forwards to the model’s chat template unchanged. The default state and the exact key are model-specific:
Example, enabling reasoning on a model that defaults to off:
- The kwarg key differs by model family: DeepSeek and Kimi use
thinking; GLM-5.2 usesenable_thinking. Passing the other key has no effect. - Top-level
enable_thinkingand top-levelreasoning_effortare not honored on these models (the one exception is GLM-5.2, which acceptsreasoning_effort: "none"to disable). Usechat_template_kwargsas shown. reasoning_effortlevels (low/high/max) are forwarded to the model verbatim and are not reliably graded. Treat reasoning as on/off, not a depth dial.
GLM-5.2 without reasoning
z-ai/glm-5.2 reasons before answering and spends output tokens on it. Clients that cap max_tokens and don’t render reasoning_content (GitHub Copilot, Cursor and similar BYOK setups) can end up with an empty visible answer because the whole budget goes into reasoning. Two ways to turn it off:
- Use the model id
z-ai/glm-5.2-instant(also listed inGET /models). Same model, same pricing, answers directly without a reasoning phase. Pick this in clients where you can’t pass request parameters. - Or send
reasoning_effort: "none"in the request body when callingz-ai/glm-5.2through the API.
Embeddings
Text embeddings use the same base URL and key:Error handling
Errors come back in one of two shapes depending on where they originate. Gateway errors are raised by Lyceum before the request reaches a model: a bad key, an unknown model ID, or insufficient credit. These use adetail string.
429 and on 5xx or timeout responses with backoff.
Serverless vs dedicated
Active Models
Browse the model IDs and context windows currently available.
Smart Routing
Automatically route each request to the right model.

