AI Gateway Quickstart
You adopt the AI Gateway by pointing your existing AI SDK at your agent’s gateway URL and using a phantom token as the API key. No new SDK, no code rewrite.1. Create an agent
In the dashboard, go to AI Gateway → New gateway, then add an agent. Pick the upstream provider (Anthropic or OpenAI) and the route that injects your provider key. When the agent is created you get two things:- an agent URL —
https://<your-slug>.knoxcall.com/v1/ai/<agent-slug>(sandbox:https://sandbox-<your-slug>.knoxcall.com/...) - a phantom token —
kc_live_a_…(shown once at mint time)
The data plane is served on your tenant’s proxy subdomain (
<slug>.knoxcall.com), not api.knoxcall.com. Always use the agent_url returned at agent creation as your base URL.2. Swap your base URL
Anthropic SDK
OpenAI SDK
curl
3. Authentication schemes
The phantom token can be sent three ways — use whichever your SDK makes easiest:DPoP proof header on every request.
4. Streaming
Streaming works unchanged — setstream: true (or Accept: text/event-stream). PII redaction runs inside the stream, so redactions appear as the tokens arrive rather than after the response completes:
Useful request/response headers
Response caching
Setcache_mode on an agent to exact (byte-identical requests replay a saved
response) or semantic (a request that means the same thing as a prior one
replays it, matched by embedding similarity).
Next steps
Bring your own key
Why AI features use your own Anthropic key, and how to add it.
Tokens & DPoP
Mint scoped, sender-constrained tokens for agents and CI.