library · inferred from evidence
@ai-sdk/openai
A provider library for OpenAI within the AI SDK ecosystem.
- Multi-provider routing: customProvider, gateway, and fallbacks
Route across providers in AI SDK 7: the AI Gateway for one-key access, customProvider for named routing with fallbacks, and per-request selection.
- Files and images in chat: uploadFile, provider references, and multimodal messages
Multimodal input in AI SDK 7: uploadFile returns a provider reference, referenced from file content parts in messages.
- Diagnose "Model is not assignable to type LanguageModelV1"
The TypeScript error that means your @ai-sdk/* provider package is from a different spec generation than your ai core: upgrade them together.
- UnsupportedModelVersionError and UnsupportedFunctionalityError
The v7 errors for spec and capability mismatches: provider package too old for the ai core, or a feature the model does not support.
- LoadAPIKeyError: the provider key env var is missing
The v7 error thrown when a provider factory cannot find its API key: names the expected env var, thrown at call time not import time.
- Pin ai and @ai-sdk/* together: the version matrix that prevents protocol errors
AI SDK 7 version discipline: ai, provider packages, and UI bindings must move together, and the v7 line-up is ai 7 with @ai-sdk/* provider 4.x era packages.
- Provider API keys: env wiring, gateway, and keeping keys off the client
Key hygiene for AI SDK 7 apps: providers read standard env vars, the gateway needs one key, custom providers take keys explicitly, and keys never ship to the browser.