Developer docs
Point your OpenAI-compatible client at DragonLair.ai, keep one wallet and one policy across eligible providers, and inspect spend in the portal.
Guides
Multi-page docs — not a single blurb. Each guide labels maturity as Ships Partial Not yet.
Use with OpenAI SDK
OpenAI Python / TypeScript / curl via base_url — no first-party SDK; OpenAPI is the contract.
Routing
model=auto, fallbacks, cascade/hedge, selected model.
Streaming
SSE chat streams and cancellation honesty.
Explainability headers
X-Darouter-* decision trail.
Tools & structured outputs
Capability-gated tools and JSON schema.
Errors
Fail-closed unsupported fields and wallet stops.
BYOK & wallet
Bring your keys; prepaid wallet without invented SKUs.
Governance
Budgets, policies, guardrails, and explainable enforcement.
Optimizer
Observe → Experiment → Evaluate → Promote/rollback.
Authentication
API keys, portal session, BYOK pointers.
FAQ
When not to use + honest FAQ linking /compare.
Why DragonLair vs a pure aggregator
Aggregators maximize catalog reach. DragonLair is an OpenAI-compatible gateway and a self-optimizing inference control plane: hard governance before ranking, evidence-driven Observe → Experiment → Evaluate → Promote/rollback, and explainable decisions.
- Route explanation headers on decisions (for example
X-Darouter-Route-Explanation). model=autoresolves to a concrete model — seeX-Darouter-Selected-Model.- Governance explanations via
X-Darouter-Governance-Explanation; cache-aware rank reasons viaX-Darouter-Cache-Reason.
Deeper category table: /compare. Maturity: /features. No GA savings, no 500-model absolutes.
Canonical API host
Use https://api.cybertronic.dev only. Do not send X-Darouter-Edge-Secret from a public client. /admin/* and POST /v1/registration are not on the public hostname.
Use the status page to confirm current service availability before production rollout.
Authentication Ships
Tenant inference and catalog routes take Authorization: Bearer <Darouter API key> (or a configured JWT). Full guide: /docs/auth.
- Opt-in public signup —
POST /v1/signupwhen Operator Platform settings haspublic_signup=true(off by default). - Portal — sign in at /portal, then
POST /v1/keys. - Operator-issued — admin-token
POST /v1/registration(not on the public host).
OpenAPI cross-links (no recipe farm)
Every guide below cites the operations that exist in /v1/openapi.json. Use OpenAI Python, OpenAI TypeScript, or curl with base_url — we do not ship a first-party SDK and we do not publish cookbook/recipe trees.
When a portal panel mentions a route not yet in OpenAPI, treat OpenAPI as the stable contract and the panel as Partial.
Quickstart
Common clients only: curl, OpenAI Python, OpenAI TypeScript. DragonLair does not ship a first-party SDK — OpenAPI is the contract. No cookbook trees.
1. List models (safe — no billed dispatch)
curl -sS https://api.cybertronic.dev/v1/models \
-H "Authorization: Bearer $DAROUTER_API_KEY"
2. Chat completion
curl -sS https://api.cybertronic.dev/v1/chat/completions \
-H "Authorization: Bearer $DAROUTER_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"auto","messages":[{"role":"user","content":"Hello"}]}'
3. OpenAI Python SDK
from openai import OpenAI
client = OpenAI(
api_key="dar_…",
base_url="https://api.cybertronic.dev/v1",
)
print(client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello"}],
))
4. TypeScript / Node (openai)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.DAROUTER_API_KEY,
baseURL: "https://api.cybertronic.dev/v1",
});
const res = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Hello" }],
});
console.log(res.choices[0]?.message);
Full common-client guide: /docs/sdk (OpenAI Python / TypeScript / curl only).
OpenAPI & agent brief
curl -sS https://api.cybertronic.dev/v1/openapi.json
# same document on the marketing host:
# https://dragonlayer.ai/v1/openapi.json
Also available: OpenAPI and the agent-readable documentation index.