Tracing only: call the gateway directly
If your app calls providers itself and uses Belvedir for observability, point your OpenAI client at the gateway and change nothing else:openai SDK, or the AI SDK’s @ai-sdk/openai-compatible provider pointed at the gateway URL). The AI SDK’s native gateway wiring (plain "provider/model" strings) uses a protocol the Belvedir SDK doesn’t instrument, so those calls produce no LLM spans. Full setup for AI SDK apps, including this swap, is in the AI SDK guide.
Routed inference: chain the router through the gateway
If Belvedir routes and executes your inference, chain the two: your app calls Belvedir’s router, and the router executes every call through your gateway.- In the Vercel dashboard, create an AI Gateway API key for the project that should own the spend.
- In the Belvedir dashboard, open your project’s settings, go to Integrations, click the Vercel AI Gateway row, paste the key, and click Connect.
Notes
- Routed model ids are sent to the gateway in their public spellings, so keep your routers on
provider/modelslugs the gateway serves (openai/gpt-5.2,anthropic/claude-sonnet-5). A model the gateway doesn’t recognize fails with the gateway’s error. - A per-model endpoint registered on the Cloud Inference page wins over the default gateway for that model. Fine-tuned and local models never fall through to the gateway; register them individually if your gateway serves them.
- The default gateway applies to routed chat completions. The Anthropic-native Messages passthrough (
/api/v1/messages) and the embeddings endpoint still execute on their built-in providers. - Spend that doesn’t pass through the gateway won’t appear in Vercel. If completeness matters, route all inference through Belvedir and check the usage pages agree.