Connect to Lunomi
Lunomi speaks both the OpenAI and the Anthropic API. Anything that lets you set a base URL and an API key works.
Basics
https://api.lunomi.io/v1
https://api.lunomi.io
Create an account to get a key. Send it as Authorization: Bearer … (OpenAI) or x-api-key: … (Anthropic).
Models and prices
| Model | Thinking | Input | Cached input | Output |
|---|---|---|---|---|
deepseek-v4.1-flash | OnThinking on | $0.220 | $0.0450 | $0.750 |
deepseek-v4.1-flash-nothink | OffThinking off | $0.220 | $0.0450 | $0.750 |
Both are DeepSeek V4.1 Flash. The -nothink variant skips the reasoning step, so it answers faster and uses fewer output tokens. Repeated prompt prefixes (system prompts, long chats) are cached automatically and billed at the cached rate.
OpenAI format
curl
curl https://api.lunomi.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Hello"}]}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.lunomi.io/v1", api_key="YOUR_API_KEY")
reply = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.lunomi.io/v1", apiKey: "YOUR_API_KEY" });
const reply = await client.chat.completions.create({
model: "deepseek-v4.1-flash",
messages: [{ role: "user", content: "Hello" }],
});
console.log(reply.choices[0].message.content);Streaming ("stream": true), tool calls and JSON mode work as they do with OpenAI.
Anthropic format
curl
curl https://api.lunomi.io/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'Python
import anthropic
client = anthropic.Anthropic(base_url="https://api.lunomi.io", api_key="YOUR_API_KEY")
reply = client.messages.create(
model="deepseek-v4.1-flash",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.content[0].text)Apps and tools
Coding agents that use the Anthropic API
export ANTHROPIC_BASE_URL="https://api.lunomi.io"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="deepseek-v4.1-flash"Cursor, Continue, Open WebUI, LibreChat, SillyTavern and similar
Add a custom “OpenAI-compatible” provider. Base URL https://api.lunomi.io/v1, your key, and model deepseek-v4.1-flash. Most apps list the models automatically from /v1/models.
Environment variables for OpenAI SDKs
export OPENAI_BASE_URL="https://api.lunomi.io/v1"
export OPENAI_API_KEY="YOUR_API_KEY"Limits and errors
| Status | Meaning | What to do |
|---|---|---|
401 | Key missing, wrong or revoked | Check the key, or create a new one |
400 budget | Balance or the key's spend limit is used up | Add credit, or raise the key's limit |
400 model | model is a list or has several names separated by commas | Send one model name per request |
402 | Not enough credit for this request, counting requests still running | Add credit, or wait for running requests to finish |
429 concurrency_limit_exceeded | Your account already has as many requests running as it may run at once (the levels are below) | Retry once one of them finishes; the OpenAI and Anthropic SDKs do this by themselves |
429 | Too many requests for this key or account, or the service is busy | Retry with backoff, after the Retry-After time if one is given |
5xx | Temporary server problem | Retry after a few seconds |
How many requests an account can run at once, across all its keys, depends on the credit it has bought: 5 to start, 15 from $20, 30 from $100, 60 from $1,000.
Each answer is at most 32,768 tokens, and less when your balance can't pay for more. The prompt and the answer together must fit in the model's 1,048,576-token context, so with a prompt close to the limit, set a smaller max_tokens. A request can run for up to 30 minutes; if your client disconnects, the request is stopped: a streamed answer is billed for the part already sent, and an unfinished answer that wasn't streamed isn't billed.
Privacy
We record token counts and cost for billing. We don't store prompts or replies, and we don't train on them. You can delete your account at any time from the Account page. The details are in the privacy policy.
Questions
Billing questionsWhich model name should I use?
Both are DeepSeek V4.1 Flash, release 1017. deepseek-v4.1-flash reasons before it answers; deepseek-v4.1-flash-nothink skips that step, so it answers sooner and writes fewer output tokens.
How long can a request be?
The prompt and the answer together can use up to 1,048,576 tokens, and one answer is at most 32,768 tokens. With a prompt close to the limit, set a smaller max_tokens.
Will my app or agent work with it?
If it lets you set a base URL and an API key, yes. Lunomi answers on the OpenAI chat completions endpoint and the Anthropic messages endpoint. Apps and tools has the exact settings for SDKs, editors and agents.