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?"}
]
}'
from openai import OpenAI
client = OpenAI(
api_key="your-lumenfall-api-key",
base_url="https://api.lumenfall.ai/openai/v1"
)
response = client.chat.completions.create(
model="google/gemini-3-flash-preview",
messages=[
{"role": "user", "content": "Why are capybaras so chill?"}
]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-lumenfall-api-key",
baseURL: "https://api.lumenfall.ai/openai/v1",
});
const response = await client.chat.completions.create({
model: "google/gemini-3-flash-preview",
messages: [
{ role: "user", content: "Why are capybaras so chill?" },
],
});
console.log(response.choices[0].message.content);
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("your-lumenfall-api-key"),
option.WithBaseURL("https://api.lumenfall.ai/openai/v1"),
)
response, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: openai.F("google/gemini-3-flash-preview"),
Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Why are capybaras so chill?"),
}),
})
if err != nil {
panic(err)
}
fmt.Println(response.Choices[0].Message.Content)
}
using OpenAI;
using OpenAI.Chat;
var options = new OpenAIClientOptions
{
Endpoint = new Uri("https://api.lumenfall.ai/openai/v1")
};
var client = new OpenAIClient("your-lumenfall-api-key", options);
var chatClient = client.GetChatClient("google/gemini-3-flash-preview");
ChatCompletion response = await chatClient.CompleteChatAsync(
[new UserChatMessage("Why are capybaras so chill?")]
);
Console.WriteLine(response.Content[0].Text);
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.ChatCompletionCreateParams;
import com.openai.models.ChatCompletionUserMessageParam;
OpenAIClient client = OpenAIOkHttpClient.builder()
.apiKey("your-lumenfall-api-key")
.baseUrl("https://api.lumenfall.ai/openai/v1")
.build();
var params = ChatCompletionCreateParams.builder()
.model("google/gemini-3-flash-preview")
.addMessage(ChatCompletionUserMessageParam.builder()
.content("Why are capybaras so chill?")
.build())
.build();
var response = client.chat().completions().create(params);
System.out.println(response.choices().get(0).message().content().orElse(null));
require "openai"
client = OpenAI::Client.new(
api_key: "your-lumenfall-api-key",
base_url: "https://api.lumenfall.ai/openai/v1"
)
response = client.chat.completions.create(
model: "google/gemini-3-flash-preview",
messages: [
{ role: "user", content: "Why are capybaras so chill?" }
]
)
puts response.choices.first.message.content
{
"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
}
}
Chat
Create chat completion
Generate text responses from a conversation
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?"}
]
}'
from openai import OpenAI
client = OpenAI(
api_key="your-lumenfall-api-key",
base_url="https://api.lumenfall.ai/openai/v1"
)
response = client.chat.completions.create(
model="google/gemini-3-flash-preview",
messages=[
{"role": "user", "content": "Why are capybaras so chill?"}
]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-lumenfall-api-key",
baseURL: "https://api.lumenfall.ai/openai/v1",
});
const response = await client.chat.completions.create({
model: "google/gemini-3-flash-preview",
messages: [
{ role: "user", content: "Why are capybaras so chill?" },
],
});
console.log(response.choices[0].message.content);
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("your-lumenfall-api-key"),
option.WithBaseURL("https://api.lumenfall.ai/openai/v1"),
)
response, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: openai.F("google/gemini-3-flash-preview"),
Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Why are capybaras so chill?"),
}),
})
if err != nil {
panic(err)
}
fmt.Println(response.Choices[0].Message.Content)
}
using OpenAI;
using OpenAI.Chat;
var options = new OpenAIClientOptions
{
Endpoint = new Uri("https://api.lumenfall.ai/openai/v1")
};
var client = new OpenAIClient("your-lumenfall-api-key", options);
var chatClient = client.GetChatClient("google/gemini-3-flash-preview");
ChatCompletion response = await chatClient.CompleteChatAsync(
[new UserChatMessage("Why are capybaras so chill?")]
);
Console.WriteLine(response.Content[0].Text);
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.ChatCompletionCreateParams;
import com.openai.models.ChatCompletionUserMessageParam;
OpenAIClient client = OpenAIOkHttpClient.builder()
.apiKey("your-lumenfall-api-key")
.baseUrl("https://api.lumenfall.ai/openai/v1")
.build();
var params = ChatCompletionCreateParams.builder()
.model("google/gemini-3-flash-preview")
.addMessage(ChatCompletionUserMessageParam.builder()
.content("Why are capybaras so chill?")
.build())
.build();
var response = client.chat().completions().create(params);
System.out.println(response.choices().get(0).message().content().orElse(null));
require "openai"
client = OpenAI::Client.new(
api_key: "your-lumenfall-api-key",
base_url: "https://api.lumenfall.ai/openai/v1"
)
response = client.chat.completions.create(
model: "google/gemini-3-flash-preview",
messages: [
{ role: "user", content: "Why are capybaras so chill?" }
]
)
puts response.choices.first.message.content
{
"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.
string
required
The model to use. Pass any OpenRouter model identifier — for example,
google/gemini-3-flash-preview or openai/gpt-5.4.array
required
A list of messages comprising the conversation. Each message has a
role and content.Show Message object
Show Message object
string
required
The role of the message author. One of
system, user, assistant, or tool.string | array | null
required
The content of the message. Can be a string, an array of content parts (for multimodal input), or
null (for assistant messages with tool calls).Content parts support text and image_url types:[
{ "type": "text", "text": "What's in this image?" },
{ "type": "image_url", "image_url": { "url": "https://example.com/image.png" } }
]
string
An optional name for the participant.
array
Tool calls generated by the model (assistant messages only).
string
The ID of the tool call this message is responding to (tool messages only).
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].number
default:"1"
Sampling temperature between 0 and 2. Higher values make output more random, lower values make it more focused.
integer
The maximum number of tokens to generate.
number
default:"1"
Nucleus sampling parameter. Only consider tokens with cumulative probability up to this value.
number
default:"0"
Penalizes tokens based on their frequency in the text so far. Range: -2.0 to 2.0.
number
default:"0"
Penalizes tokens based on whether they appear in the text so far. Range: -2.0 to 2.0.
string | array
Up to 4 sequences where the model will stop generating.
array
A list of tools the model may call. Currently only
function type tools are supported.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
object
The format of the response. Set
{"type": "json_object"} to enable JSON mode.integer
A seed for deterministic generation. Not all models support this.
string
A unique identifier representing your end-user.
boolean
default:"false"
Whether to return log probabilities of the output tokens.
integer
Number of most likely tokens to return at each position (0-20). Requires
logprobs: true.object
Options for streaming responses.
Show Stream options
Show Stream options
boolean
If
true, an additional chunk is sent with usage information when streaming.Response
string
A unique identifier for the chat completion.
string
Always
chat.completion.integer
Unix timestamp of when the completion was created.
string
The model used for the completion.
array
A list of chat completion choices.
Show Choice object
Show Choice object
integer
The index of the choice.
object
string
The reason the model stopped generating. One of
stop, length, tool_calls, or content_filter.object
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:
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?"}
]
}'
from openai import OpenAI
client = OpenAI(
api_key="your-lumenfall-api-key",
base_url="https://api.lumenfall.ai/openai/v1"
)
response = client.chat.completions.create(
model="google/gemini-3-flash-preview",
messages=[
{"role": "user", "content": "Why are capybaras so chill?"}
]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-lumenfall-api-key",
baseURL: "https://api.lumenfall.ai/openai/v1",
});
const response = await client.chat.completions.create({
model: "google/gemini-3-flash-preview",
messages: [
{ role: "user", content: "Why are capybaras so chill?" },
],
});
console.log(response.choices[0].message.content);
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("your-lumenfall-api-key"),
option.WithBaseURL("https://api.lumenfall.ai/openai/v1"),
)
response, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: openai.F("google/gemini-3-flash-preview"),
Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Why are capybaras so chill?"),
}),
})
if err != nil {
panic(err)
}
fmt.Println(response.Choices[0].Message.Content)
}
using OpenAI;
using OpenAI.Chat;
var options = new OpenAIClientOptions
{
Endpoint = new Uri("https://api.lumenfall.ai/openai/v1")
};
var client = new OpenAIClient("your-lumenfall-api-key", options);
var chatClient = client.GetChatClient("google/gemini-3-flash-preview");
ChatCompletion response = await chatClient.CompleteChatAsync(
[new UserChatMessage("Why are capybaras so chill?")]
);
Console.WriteLine(response.Content[0].Text);
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.ChatCompletionCreateParams;
import com.openai.models.ChatCompletionUserMessageParam;
OpenAIClient client = OpenAIOkHttpClient.builder()
.apiKey("your-lumenfall-api-key")
.baseUrl("https://api.lumenfall.ai/openai/v1")
.build();
var params = ChatCompletionCreateParams.builder()
.model("google/gemini-3-flash-preview")
.addMessage(ChatCompletionUserMessageParam.builder()
.content("Why are capybaras so chill?")
.build())
.build();
var response = client.chat().completions().create(params);
System.out.println(response.choices().get(0).message().content().orElse(null));
require "openai"
client = OpenAI::Client.new(
api_key: "your-lumenfall-api-key",
base_url: "https://api.lumenfall.ai/openai/v1"
)
response = client.chat.completions.create(
model: "google/gemini-3-flash-preview",
messages: [
{ role: "user", content: "Why are capybaras so chill?" }
]
)
puts response.choices.first.message.content
{
"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
}
}