Deploy Agent
Docs/AI Models/Lobstack AI Gateway
AI

Lobstack AI Gateway

The Lobstack Gateway is the unified, intelligent layer every agent uses to reach a model. Bring your own key — or use Lobstack AI and skip keys entirely. Either way, requests are routed to the most cost-effective model and metered automatically.

Two ways to power your agent#

Use Lobstack AI (managed)

No API key required. Lobstack provides access to every model and meters usage against your plan. Pick this at onboarding to go live in seconds.

🔑

Bring your own key (BYOK)

Use your own provider key. Requests still flow through the gateway so you get Token Intelligence routing and unified usage analytics — your key, never leaving your VM for other providers.

Token Intelligence#

Every message is scored for complexity (0–100) and routed to the cheapest model that can handle it, never exceeding your plan's ceiling. A one-line reply doesn't need a flagship model; a multi-step coding task does. Choose a specific model, or select Auto and let Lobstack pick per message.

TierUsed forExample models
nanoTrivial replies, acknowledgementsGPT-5 Nano, Mistral Small
smallSimple Q&A, short tasksGPT-5 Mini, DeepSeek V3
standardEveryday agent workClaude Sonnet 4.5, GPT-4o, Gemini 2.5 Pro
premiumComplex reasoning & codeGPT-5, Mistral Large
flagshipHardest, highest-stakes tasksClaude Opus 4.6, GPT-5.2

BYOK stays on your provider

In BYOK mode, Token Intelligence only routes within your key's provider — a Claude key is never used to call OpenAI. Managed mode routes freely across providers.

OpenAI-compatible API#

The gateway speaks the OpenAI Chat Completions format, so existing tooling works unchanged. Send model: "auto" to enable Token Intelligence, or a specific model id.

POST /api/gateway/v1/chat/completions
curl https://lobstack.ai/api/gateway/v1/chat/completions \
  -H "Authorization: Bearer $LOBSTACK_GATEWAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Summarize today\'s standup notes"}]
  }'

The response is standard OpenAI JSON. Routing details come back in headers: x-lobstack-model, x-lobstack-tier, x-lobstack-complexity, x-lobstack-savings, and x-lobstack-cost-usd. List available models at GET /api/gateway/v1/models.

Usage & message credits#

Every plan includes a monthly message allowance. With Lobstack AI, model usage is covered by your plan — no separate provider bill. If you run out before your period resets, buy a message-credit top-up from the dashboard; credits are spent automatically once your monthly allowance is used up.

PlanMessages / month
Starter1,000
Pro5,000
Performance15,000
Enterprise50,000
💡

Switch anytime

You can switch between Lobstack AI and your own key, or toggle Auto, from Dashboard → Settings — changes apply with zero downtime.