Gateway & API

gateway.idlidu.dev is the prepaid, Bottom-first inference front. api.idlidu.dev holds accounts, keys, usage, and billing. Id uses both; any OpenAI-compatible client can use the gateway alone.

Hosts

HostPurpose
https://gateway.idlidu.devChat completions, models, health, agent handoff
https://api.idlidu.devAuth, keys, credits, usage, alerts, settings
https://app.idlidu.devBrowser console (session cookie)
https://pay.idlidu.devPayU checkout for prepaid packs

Authentication

  • API keyAuthorization: Bearer idl_… (gateway + most API routes)
  • Session — HttpOnly cookie on .idlidu.dev after app login (billing checkout)

Mint keys in app → API keys. Each key has a turn budget default, optional hard limit ($ lifetime), and spent counter.

Chat completions

OpenAI-shaped POST /v1/chat/completions on the gateway:

curl https://gateway.idlidu.dev/v1/chat/completions \
  -H "Authorization: Bearer idl_…" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bottom",
    "messages": [{"role":"user","content":"ping"}]
  }'
  • model: "bottom" — gateway picks the cheapest capable catalog id
  • Explicit catalog id — pin that model (see Models)
  • Usage billed at 1.5× provider token cost against prepaid balance

Streaming: set "stream": true (SSE). Headers may include balance / alert hints.

Health & models

curl -s https://gateway.idlidu.dev/health | jq .
# expect: ok, catalog size, bottom_ready

GET /v1/models lists the catalog Id shows via Id models. Product page: /models.

Agent HTTP

Long-running / cloud agent runs go through the gateway agent surface (Id handoff, Id serve clients). Protocol details: Agent API.

Credits & me

  • GET /v1/me / GET /v1/credits — balance, key meta, alerts
  • Burn happens on successful inference; hard limit and $0 balance reject further spend

Full URL list: Reference.

Errors you will see

SymptomLikely cause
401 / invalid keyRevoked or mistyped idl_; stale shell ID_API_KEY
402 / insufficientAccount balance $0 or key hard limit hit
Turn stopped earlyLocal --budget / key turn budget
Checkout disabledPay soft-off until launch; see Billing

Bottom routing · Billing · Id · Status