references/ai-gateway/sdk-integration.md
AI Gateway SDK Integration
Choose an integration that matches the application's runtime and required API shape. Fetch its guide before installing packages or writing requests; model identifiers, SDK options, and gateway headers belong in the docs.
| Integration task | Current documentation | |------------------|-----------------------| | New single-model HTTP calls or OpenAI-compatible clients | REST API | | Vercel AI SDK, provider adapters, and fallback providers | Vercel AI SDK integration | | Preserve OpenAI-native endpoints with the OpenAI SDK, Python, or HTTP | OpenAI provider guide | | Preserve Anthropic-native requests | Anthropic provider guide | | Use another provider or a framework's configurable provider endpoint | Provider guides — match the framework's expected API shape to the provider endpoint | | Configure Workers AI and an AI binding | Binding setup | | Call Workers AI or third-party models from a Worker; use gateway methods | Workers binding methods | | Set request metadata, caching, or other gateway headers | Header glossary | | Invoke a dynamic route | Dynamic route usage |
The legacy Unified API is deprecated for single-model calls, but dynamic routes still require its compatibility endpoint. Do not migrate a dynamic route to the REST inference endpoint as though it were a single-model call.
Confirm gateway authentication and provider credentials separately, including the selected path's BYOK and billing behavior.