Documentation

Lumewise is an OpenAI-compatible AI gateway. If your code talks to OpenAI today, it works with Lumewise by changing two lines.

Quickstart

1. Create an account and add a provider key (OpenAI, Anthropic, Google, Groq…) in Providers. 2. Create a gateway key in API Keys. 3. Point your client at the gateway:

bash — first request in 30 seconds
curl https://lumewise.huynext.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer lw-YOUR_KEY" \
  -d '{
    "model": "lumewise/budget",
    "messages": [{"role": "user", "content": "Explain DNS in one sentence"}]
  }'

Models & routing

The model field accepts:

lumewise/frontier · lumewise/standard · lumewise/budget

Built-in quality tiers. Lumewise routes to the cheapest model in the tier among your configured providers, with automatic fallback. standard is the sweet spot for most production traffic; budget for high-volume simple tasks; frontier when quality is non-negotiable.

gpt-4o-mini, claude-haiku-4-5, gemini-2.5-flash…

Canonical model names resolve across all your configured providers, cheapest-first. If you only use one provider for a model, behavior is identical to calling it directly.

provider/model — e.g. groq/llama-3.3-70b-versatile

Explicit provider pinning. The upstream model id is passed through verbatim — useful for new models the registry doesn't price yet, and for OpenRouter's full catalog.

your custom aliases

Create chains in Routes with priority / cheapest / round-robin strategies. Example: alias smart → claude-sonnet-4-5, fallback gpt-5-mini, fallback gemini-2.5-flash.

List everything routable with your keys: GET /v1/models (authenticated).

Authentication

Gateway keys use the standard OpenAI Bearer pattern. Keys are shown once at creation and stored as SHA-256 hashes — even database access reveals nothing usable.

Authorization: Bearer im-…

Errors & fallback behavior

Lumewise automatically tries the next candidate in the chain (max 3 attempts) on:

Truly client-intrinsic errors (400 invalid requests and content-filter refusals) fail fast without retries — retrying them wastes latency and money. Error responses follow the OpenAI error shape so your existing error handling keeps working.

Response caching

Enable per-key in API Keys (Pro plan+). Exact-match caching: identical non-streaming requests within the TTL (1h default) are served from cache at zero provider cost. Cache hits count fully in your savings ledger. Requests are fingerprinted with keyed HMAC on model + messages + parameters — never shared across projects. Cached response bodies are AES-256-GCM encrypted at rest.

SDK examples

Python

python
from openai import OpenAI

client = OpenAI(
    base_url="https://lumewise.huynext.com/v1",
    api_key="lw-YOUR_KEY",
)

resp = client.chat.completions.create(
    model="lumewise/standard",
    messages=[{"role": "user", "content": "Summarize this quarter's OKRs"}],
)
print(resp.choices[0].message.content)

TypeScript / Node

typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://lumewise.huynext.com/v1",
  apiKey: "lw-YOUR_KEY",
});

const resp = await client.chat.completions.create({
  model: "lumewise/budget",
  messages: [{ role: "user", content: "Classify this ticket" }],
  stream: true,  // streaming fully supported, incl. Anthropic/Google translation
});

Vercel AI SDK

typescript
import { createOpenAI } from "@ai-sdk/openai";

const lumewise = createOpenAI({
  baseURL: "https://lumewise.huynext.com/v1",
  apiKey: process.env.LUMEWISE_KEY,
});

// then use lumewise("lumewise/standard") like any model

Security model

Limits & quotas

PlanRequests/moRate limitRetentionCaching
Free10K60 rpm7 days—
Pro — $29/mo200K600 rpm30 days✓
Team — $99/mo1M3K rpm90 days✓

Quotas are hard caps — requests beyond the cap return 429 with a clear upgrade message. We never bill overages automatically.

Ready to see your savings number?

Start free