LuluTokens

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.

Export it

export LULUTOKENS_API_KEY="sk-..."

Most tools also read OPENAI_API_KEY; which one you need depends on the client, and each page under Usage says which.

Your first request

curl
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.

hello.py
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
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:

EndpointShapeUse it for
GET /v1/modelsOpenAIListing the models your key can reach
POST /v1/chat/completionsOpenAIThe default for almost every client
POST /v1/responsesOpenAI ResponsesCodex CLI and other Responses-API clients
POST /v1/messagesAnthropicClaude 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.

StatusMeaningWhat to do
401Missing or invalid keyCheck the Authorization: Bearer header
400Bad request or unknown modelVerify the model ID against /v1/models
402Out of creditTop up in the console
429Rate limitedBack off and retry
5xxUpstream provider errorRetry, 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.

Next steps

On this page