Use OpenAI SDK with Manifest
The OpenAI Python and TypeScript SDKs talk to any OpenAI-compatible endpoint. Point
them at Manifest by setting OPENAI_BASE_URL
and every chat completion, response, tool call, or Agents SDK loop routes through
the cheapest capable model.
— models routed through Manifest over the last 30 days.
Why use the OpenAI SDK with Manifest
Chatty workloads (Agents SDK loops, tool retries, chain-of-thought reasoning) burn tokens fast. Manifest intercepts each call, picks the right model, and keeps your code identical. Same SDK, same shapes, lower bill.
- One env var change: OPENAI_BASE_URL
- Slash token spend by 50–70% on chatty agent loops
- Works for the OpenAI SDK and the OpenAI Agents SDK
- Tool calling, structured outputs, and streaming all pass through
- Per-app spend caps and audit logs in the dashboard
- Open source: inspect and self-host the router
Setup in 60 seconds
Set two environment variables and the OpenAI SDK picks them up on the next run, no code changes required.
Point the SDK at Manifest by setting these env vars in your shell or
.env file:
export OPENAI_BASE_URL="https://api.manifest.build/v1"
export OPENAI_API_KEY="mnfst_YOUR_KEY"
Then use the SDK exactly as you would normally. Just point at
"auto" to let Manifest pick the model:
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello"}],
)
import OpenAI from "openai";
const client = new OpenAI();
const response = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Hello" }],
});
https://api.manifest.build/v1
mnfst_YOUR_KEY
auto
OpenAI SDK tokens processed on Manifest
Models in use
# Model |
Auth type | Tokens / last 30 days |
|---|---|---|