Skip to main content
POST
/
openai
/
v1
/
chat
/
completions
curl https://api.lumenfall.ai/openai/v1/chat/completions \
  -H "Authorization: Bearer $LUMENFALL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-3-flash-preview",
    "messages": [
      {"role": "user", "content": "Why are capybaras so chill?"}
    ]
  }'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1702345678,
  "model": "google/gemini-3-flash-preview",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Capybaras are remarkably calm animals for several reasons. As the largest rodents in the world, they have few natural predators in their South American habitats, which means they haven't evolved a strong flight-or-fight response. They're also highly social and semi-aquatic, spending much of their time lounging in warm water - which would make anyone relaxed!"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 71,
    "total_tokens": 85
  }
}
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.
model
string
required
The model to use. Pass any OpenRouter model identifier — for example, google/gemini-3-flash-preview or openai/gpt-5.4.
messages
array
required
A list of messages comprising the conversation. Each message has a role and content.
stream
boolean
default:"false"
If true, the response is sent as server-sent events (SSE). Partial message deltas are sent as data: {json} lines, ending with data: [DONE].
temperature
number
default:"1"
Sampling temperature between 0 and 2. Higher values make output more random, lower values make it more focused.
max_tokens
integer
The maximum number of tokens to generate.
top_p
number
default:"1"
Nucleus sampling parameter. Only consider tokens with cumulative probability up to this value.
frequency_penalty
number
default:"0"
Penalizes tokens based on their frequency in the text so far. Range: -2.0 to 2.0.
presence_penalty
number
default:"0"
Penalizes tokens based on whether they appear in the text so far. Range: -2.0 to 2.0.
stop
string | array
Up to 4 sequences where the model will stop generating.
tools
array
A list of tools the model may call. Currently only function type tools are supported.
tool_choice
string | object
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
response_format
object
The format of the response. Set {"type": "json_object"} to enable JSON mode.
seed
integer
A seed for deterministic generation. Not all models support this.
user
string
A unique identifier representing your end-user.
logprobs
boolean
default:"false"
Whether to return log probabilities of the output tokens.
top_logprobs
integer
Number of most likely tokens to return at each position (0-20). Requires logprobs: true.
stream_options
object
Options for streaming responses.

Response

id
string
A unique identifier for the chat completion.
object
string
Always chat.completion.
created
integer
Unix timestamp of when the completion was created.
model
string
The model used for the completion.
choices
array
A list of chat completion choices.
usage
object
Token usage statistics for the request.

Streaming

When stream: 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:
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1702345678,"model":"google/gemini-3-flash-preview","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1702345678,"model":"google/gemini-3-flash-preview","choices":[{"index":0,"delta":{"content":"Capybaras"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1702345678,"model":"google/gemini-3-flash-preview","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]
curl https://api.lumenfall.ai/openai/v1/chat/completions \
  -H "Authorization: Bearer $LUMENFALL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-3-flash-preview",
    "messages": [
      {"role": "user", "content": "Why are capybaras so chill?"}
    ]
  }'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1702345678,
  "model": "google/gemini-3-flash-preview",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Capybaras are remarkably calm animals for several reasons. As the largest rodents in the world, they have few natural predators in their South American habitats, which means they haven't evolved a strong flight-or-fight response. They're also highly social and semi-aquatic, spending much of their time lounging in warm water - which would make anyone relaxed!"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 71,
    "total_tokens": 85
  }
}