Public docs API base https://api.lunomi.io
LunomiMenu
Theme

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

Base URL, OpenAI format
https://api.lunomi.io/v1
Base URL, Anthropic format
https://api.lunomi.io
It stays in this page and is never sent anywhere.

Create an account to get a key. Send it as Authorization: Bearer … (OpenAI) or x-api-key: … (Anthropic).

Models and prices

USD per million tokens, launch pricing
ModelThinkingInputCached inputOutput
deepseek-v4.1-flashOnThinking on $0.220$0.0450$0.750
deepseek-v4.1-flash-nothinkOffThinking 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

/v1/chat/completions

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

/v1/messages

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

HTTP status codes
StatusMeaningWhat to do
401Key missing, wrong or revokedCheck the key, or create a new one
400 budgetBalance or the key's spend limit is used upAdd credit, or raise the key's limit
400 modelmodel is a list or has several names separated by commasSend one model name per request
402Not enough credit for this request, counting requests still runningAdd credit, or wait for running requests to finish
429 concurrency_limit_exceededYour 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
429Too many requests for this key or account, or the service is busyRetry with backoff, after the Retry-After time if one is given
5xxTemporary server problemRetry 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 questions
Which 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.