Adapted from
docs/sdks/in black-candle-technologies/chitin.
Drop-in OpenAI-compatible clients for the Chitin AI gateway. Point existing code at Chitin and get automatic token savings with zero application changes.
Cross-language conventions (naming, types, error handling, retries, async) are defined in docs/sdks/SPEC.md.
@chitin/sdknpm install @chitin/sdk # or: pnpm add @chitin/sdk
import { ChitinClient } from "@chitin/sdk";
const client = new ChitinClient({ apiKey: "cht-..." });
const completion = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello" }],
});
Responses include gateway metadata (cache hits, savings) alongside the standard OpenAI shape.
chitinpip install chitin # or: uv add chitin
from chitin import ChitinClient
client = ChitinClient(api_key="cht-...") # or set CHITIN_API_KEY
completion = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}],
)
| Variable | Description | Default |
|---|---|---|
CHITIN_API_KEY |
Your Chitin API key | Falls back to OPENAI_API_KEY |
CHITIN_BASE_URL |
Gateway base URL (self-hosted) | https://api.usechitin.com/v1 |
Both SDKs ship sync and async clients (ChitinClient / AsyncChitinClient), plus a management client, streaming support, retry transport, and webhook verification. Each SDK repo docs folder has the full API reference, CLI reference, changelog, and roadmap.
See also: Chitin overview · Backend