Runnable samples for calling API Keychain with common tools and SDKs.
| Directory | Description |
|---|---|
| curl/ | Shell scripts for chat, streaming, and model listing |
| python/ | OpenAI Python SDK |
| typescript/ | OpenAI SDK (TypeScript) |
| node/ | OpenAI SDK (Node ESM) |
| nextjs/ | Next.js App Router server route |
- Running gateway (
uvicorn main:app --reload) - Keychain
ak-key from the dashboard - At least one upstream provider key configured
| Variable | Default | Description |
|---|---|---|
KEYCHAIN_KEY |
— | Your ak-... bearer token |
GATEWAY_URL |
http://localhost:8000 |
Gateway base URL (no /v1 suffix) |
Use these as the model parameter for OpenAI clients:
keychain-low— fast (smallest free models)keychain-medium— balancedkeychain-high— best free models in the cascade
For Claude Code, set ANTHROPIC_BASE_URL to your gateway host and use your
ak- key. Model names like claude-sonnet-4-6 map to the medium tier.
See docs/getting-started.md for the full walkthrough.