LuluTokens

API reference

Every endpoint the LuluTokens relay exposes, the headers it accepts, and the errors it returns.

LuluTokens is a relay. It speaks three wire formats — OpenAI, OpenAI Responses, and Anthropic Messages — and forwards to whichever provider serves the model you named. There is no LuluTokens-specific request format to learn: if your client already talks to one of those three, it already talks to us.

Base URL

https://api.lulutokens.ai/v1

Auth

Authorization: Bearer sk-...

Authentication

Every request needs a key from the console. The standard header works everywhere:

Authorization: Bearer sk-...

Two provider-specific alternatives are accepted so that unmodified SDKs work:

HeaderAccepted onUsed by
x-api-key/v1/messages, /v1/modelsAnthropic SDK, Claude Code
x-goog-api-key/v1beta/*, /v1/models/*Google GenAI SDK

The Gemini convention of passing the key in the query string — ?key=sk-... — is also accepted, but do not use it. Query strings are recorded in access logs and proxy logs in full, where headers are not, so a key sent that way ends up written to disk in plaintext. Send x-goog-api-key instead.

Endpoints

Only the paths below are routed. Anything else returns 404 at the edge, before it reaches the gateway — account, billing and admin operations live in the console, not on api..

OpenAI format

MethodPathUse it for
GET/v1/modelsList the models your key can reach
GET/v1/models/{model}Retrieve one model
POST/v1/chat/completionsThe default for almost every client
POST/v1/embeddingsEmbeddings — see the note below
POST/v1/images/generationsText to image
POST/v1/images/editsImage editing
POST/v1/editsImage editing, legacy path

OpenAI Responses format

MethodPathUse it for
POST/v1/responsesCodex CLI and other Responses-API clients
POST/v1/responses/compactCodex context compaction
POST/v1/alpha/searchCodex standalone web search

Anthropic format

MethodPathUse it for
POST/v1/messagesClaude Code and Anthropic SDK clients

The Anthropic base URL is https://api.lulutokens.ai without /v1 — the Anthropic client appends /v1/messages itself. Every other format wants the /v1 included. This one difference causes more setup failures than anything else on this page.

Gemini format

MethodPathUse it for
GET/v1beta/modelsList, Gemini-shaped
GET/v1beta/openai/modelsList, OpenAI-shaped
POST/v1beta/models/{model}:{action}Native Gemini relay, e.g. :generateContent

Video

For the doubao-seedance models. Both shapes reach the same backend — submit, then poll for the result.

MethodPathUse it for
POST/v1/video/generationsSubmit a job
GET/v1/video/generations/{id}Poll it
POST/v1/videosSubmit, OpenAI-compatible shape
GET/v1/videos/{id}Poll it
GET/v1/videos/{id}/contentDownload the finished video
POST/v1/videos/{id}/remixEdit an existing result

/v1/embeddings is routed, but no model in the current catalogue is an embedding model. A call reaches the gateway and is rejected because the model has no price — an unpriced model is refused, never billed as free. Check Models before building against it.

Not exposed

Deliberately 404, because nothing we sell uses them: /v1/audio/*, /v1/rerank, /v1/files, /v1/fine-tunes, /v1/moderations, /v1/realtime, the legacy /v1/completions, and the Midjourney, Suno, Kling and Jimeng task routes.

If you need one of these, ask — opening a path is a configuration change on our side, not a code change on yours.

Errors

Errors come back as JSON with an error object:

{
  "error": {
    "code": "",
    "message": "Invalid token (request id: 202608130951046830461698268d9d68VnCnMQr)",
    "type": "new_api_error"
  }
}

The request id is inside the message, not in a separate field. Quote it when you contact support — it is how a request is found in the logs.

StatusMeaningWhat to do
400Bad request, or a model your key cannot reachVerify the model ID against /v1/models
401Missing or invalid keyCheck the Authorization: Bearer header
402Out of creditTop up in the console. There is no grace period and no negative balance
404Path not routedSee below — the content type tells you which layer answered
429Rate limitedBack off and retry
5xxUpstream provider errorRetry, or fall back to another model

Telling the two 404s apart. A 404 with Content-Type: application/json came from the gateway: the path is routed, but the thing you asked for does not exist. A 404 with Content-Type: text/plain and the body Not found came from the edge: that path is not exposed at all, and the request never reached the gateway or your usage log. The second kind is almost always a base URL missing /v1, or a client calling an endpoint from the "not exposed" list above.

Usage and cost

Every response carries a usage object with the token counts the request was billed on. Cached input tokens, where a model supports caching, are reported separately and billed at the lower cache rate.

Our metering records are what you are charged on — not a client-side tokenizer estimate. The console's request log shows the exact cost, model, token counts and timestamp of every individual request, and the ratios that were applied to it.

Next steps

On this page