Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Examples

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

Prerequisites

  1. Running gateway (uvicorn main:app --reload)
  2. Keychain ak- key from the dashboard
  3. At least one upstream provider key configured

Environment variables

Variable Default Description
KEYCHAIN_KEY Your ak-... bearer token
GATEWAY_URL http://localhost:8000 Gateway base URL (no /v1 suffix)

Effort tiers

Use these as the model parameter for OpenAI clients:

  • keychain-lowfast (smallest free models)
  • keychain-mediumbalanced
  • keychain-highbest 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.