Use with the OpenAI SDK
Ships Point common OpenAI clients at DragonLair with base_url + your project API key. We do not ship a first-party DragonLair SDK (no @dragonlair/sdk / first-party client packages). OpenAPI is the contract.
No cookbook or recipe trees — these three examples (OpenAI Python, OpenAI TypeScript, curl) are enough to hit the gateway. Deeper behavior lives in the other guides and OpenAPI.
base_url + API key
Set the client base URL to https://api.cybertronic.dev/v1 (include /v1). Use a Darouter project key (dar_…) from the portal — not a provider key (unless you intentionally configure BYOK server-side).
export DAROUTER_API_KEY=dar_…
# OpenAPI contract (same document on marketing host):
curl -sS https://api.cybertronic.dev/v1/openapi.json | head
# https://dragonlayer.ai/v1/openapi.json
OpenAI Python SDK
pip install openai
export DAROUTER_API_KEY=dar_…
python - <<'PY'
from openai import OpenAI
client = OpenAI(
api_key=__import__('os').environ['DAROUTER_API_KEY'],
base_url='https://api.cybertronic.dev/v1',
)
print(client.models.list())
print(client.chat.completions.create(
model='auto',
messages=[{'role': 'user', 'content': 'Hello from DragonLair'}],
))
PY
OpenAI TypeScript SDK
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.DAROUTER_API_KEY!,
baseURL: "https://api.cybertronic.dev/v1",
});
const models = await client.models.list();
console.log(models.data.slice(0, 3));
const chat = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Hello from DragonLair" }],
});
console.log(chat.choices[0]?.message);
curl
export DAROUTER_API_KEY=dar_…
curl -sS https://api.cybertronic.dev/v1/models \
-H "Authorization: Bearer $DAROUTER_API_KEY" | head
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":"ping"}]}'
What this page does not claim
- No first-party
dragonlair/@dragonlair/sdkpackage. - No LangChain / Vercel / framework cookbook farm — use OpenAPI + these common clients.
- Native protocol harnesses (Messages / Responses / Gemini) remain exact PREVIEW subsets — see /features, not this page.
OpenAPI is the contract
Deep links (no first-party SDK; no cookbooks):
- /v1/openapi.json and
GET /v1/openapi.json GET /v1/models,POST /v1/chat/completions— the three common-client samples above- Explainability after the call:
GET /v1/optimizer/decisions/{decision_id}