Chat
Create chat completion
Generate text responses from a conversation
POST
Modern media applications don’t just generate images and videos — they also make dozens of LLM calls for prompting, captioning, moderation, and orchestration. Instead of juggling a separate provider or router for text, you can use the same Lumenfall SDK, API key, and base URL you already use for media generation. One platform, one bill, no context-switching.
Powered by OpenRouterText completions are routed through OpenRouter, giving you access to all hundreds of models available on their platform — from OpenAI, Google, Anthropic, Meta, Mistral, and many more providers. All OpenRouter features are fully supported. Use any model by passing its OpenRouter model identifier (e.g.,
google/gemini-3-flash-preview). You can optionally prefix with openrouter/ (e.g., openrouter/google/gemini-3-flash-preview), but it is not required.OpenAI compatibilityThis endpoint implements the OpenAI Chat Completions API. You can use any OpenAI SDK by changing the base URL to
https://api.lumenfall.ai/openai/v1.Request body
You can include additional parameters not listed here. They will be passed through to the underlying provider.
The model to use. Pass any OpenRouter model identifier — for example,
google/gemini-3-flash-preview or openai/gpt-5.4.A list of messages comprising the conversation. Each message has a
role and content.If
true, the response is sent as server-sent events (SSE). Partial message deltas are sent as data: {json} lines, ending with data: [DONE].Sampling temperature between 0 and 2. Higher values make output more random, lower values make it more focused.
The maximum number of tokens to generate.
Nucleus sampling parameter. Only consider tokens with cumulative probability up to this value.
Penalizes tokens based on their frequency in the text so far. Range: -2.0 to 2.0.
Penalizes tokens based on whether they appear in the text so far. Range: -2.0 to 2.0.
Up to 4 sequences where the model will stop generating.
A list of tools the model may call. Currently only
function type tools are supported.Controls which tool the model calls. Options:
"none"- Do not call any tool"auto"- Model decides whether to call a tool"required"- Model must call a tool{"type": "function", "function": {"name": "my_function"}}- Call a specific function
The format of the response. Set
{"type": "json_object"} to enable JSON mode.A seed for deterministic generation. Not all models support this.
A unique identifier representing your end-user.
Whether to return log probabilities of the output tokens.
Number of most likely tokens to return at each position (0-20). Requires
logprobs: true.Options for streaming responses.
Response
A unique identifier for the chat completion.
Always
chat.completion.Unix timestamp of when the completion was created.
The model used for the completion.
A list of chat completion choices.
Token usage statistics for the request.
Streaming
Whenstream: true is set, the response is sent as server-sent events. Each event contains a chat.completion.chunk object with a delta field instead of message: