Quickstart
Make your first LuluTokens API call in under five minutes.
LuluTokens is an OpenAI-compatible API gateway. Point any OpenAI, Anthropic or OpenAI-Responses client at our base URL, swap in a LuluTokens key, and you can reach every model on the platform without changing your code.
Base URL
https://api.lulutokens.ai/v1
Auth
Bearer token — your LuluTokens API key
Get an API key
Create an account
Sign up at console.lulutokens.ai. New accounts start with a small trial balance so you can test before topping up.
Create a key
Open Keys in the console and create a new
API key. Keys look like sk-....
The key is shown once. Store it in a password manager or a secret store — never commit it to git, and never ship it in browser or mobile code.
Your first request
curl https://api.lulutokens.ai/v1/chat/completions \
-H "Authorization: Bearer $LULUTOKENS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{ "role": "user", "content": "Say hello in one sentence." }
]
}'Replace deepseek-v4-pro with any model ID from Models. Passing an
ID that is not enabled on your account returns a 400 with model_not_found.
With an SDK
Because the API is OpenAI-compatible, the official OpenAI SDKs work unchanged —
you only override base_url / baseURL. The Anthropic and Google SDKs work too;
see Client SDKs.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["LULUTOKENS_API_KEY"],
base_url="https://api.lulutokens.ai/v1",
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(response.choices[0].message.content)Streaming
Set stream: true and read the server-sent events. The stream ends with a
data: [DONE] line, exactly as with OpenAI.
curl https://api.lulutokens.ai/v1/chat/completions \
-H "Authorization: Bearer $LULUTOKENS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"stream": true,
"messages": [{ "role": "user", "content": "Count to five." }]
}'Which endpoints exist
The API domain exposes only relay paths. Anything else returns 404 — account,
billing and admin operations live in the console, not on api.. The ones you are
most likely to need:
| Endpoint | Shape | Use it for |
|---|---|---|
GET /v1/models | OpenAI | Listing the models your key can reach |
POST /v1/chat/completions | OpenAI | The default for almost every client |
POST /v1/responses | OpenAI Responses | Codex CLI and other Responses-API clients |
POST /v1/messages | Anthropic | Claude Code and Anthropic SDK clients |
Images, video, the native Gemini surface and the rest are in the API reference.
The Anthropic endpoint expects the Anthropic wire format, so its base URL is
https://api.lulutokens.ai without /v1 — the client appends /v1/messages
itself. See Claude Code.
Errors
Errors come back as JSON with an error object, and the request id is inside the
message — quote it if you contact support.
| Status | Meaning | What to do |
|---|---|---|
401 | Missing or invalid key | Check the Authorization: Bearer header |
400 | Bad request or unknown model | Verify the model ID against /v1/models |
402 | Out of credit | Top up in the console |
429 | Rate limited | Back off and retry |
5xx | Upstream provider error | Retry, or fall back to another model |
A 404 answered as plain text rather than JSON did not come from the gateway at
all — that path is not exposed. See the
API reference for how to tell the two apart.