The gateway is the lowest-effort way to capture cost. You change the base URL of your existing AI SDK to Yardstick's gateway and add one header. Yardstick forwards the request to the provider unchanged, streams the response back, and records the token usage & cost automatically.
On the Connect page, open the AI gateway card and generate a key (starts with
ysk_). The key is shown once, so copy it.
Set your SDK base URL to the gateway URL shown on the card and add the header
x-yardstick-key: ysk_.... Keep sending your own provider key; Yardstick forwards it.
Eleven providers are supported today: Anthropic, OpenAI, Gemini, OpenRouter, Groq, Mistral, DeepSeek, Together, Fireworks, Moonshot (Kimi) & Perplexity, each with its native SDK snippet on the card, and streaming works. The gateway also tags which tool made each call (Claude Code, Codex, Gemini CLI, Cursor & more), so cost lands on the right agent. Every call's cost flows into your spend & ROI.
