Configure API authentication
A server needs explicit credential configuration instead of relying on the default provider.
AI Tools · Function
createFireworks builds a customized Fireworks provider for the AI SDK. Configure credentials, endpoint routing, headers, or request handling, then use the returned provider to create Fireworks models.
createFireworks creates a customized Fireworks provider instance from @ai-sdk/fireworks. Pass provider settings such as an API key, an alternate API base URL, custom headers, or a replacement fetch implementation; the returned provider can then create Fireworks language models.
createFireworks(options)| Name | Type | Description |
|---|---|---|
options | object | Optional provider configuration, including baseURL, apiKey, headers, and fetch. |
A customized Fireworks provider instance.
import { createFireworks } from '@ai-sdk/fireworks';
const fireworks = createFireworks({
apiKey: process.env.FIREWORKS_API_KEY ?? '',
});
const model = fireworks('accounts/fireworks/models/llama-v3p1-8b-instruct');Creates a customized Fireworks provider and uses it to select a Fireworks model.
A server needs explicit credential configuration instead of relying on the default provider.
Requests must pass through an internal gateway or compatible endpoint.
An application needs provider-specific headers or custom request instrumentation.
createFireworks is the factory for a customized Fireworks provider instance. Import it from @ai-sdk/fireworks and pass provider settings such as apiKey.
Follow-up: How can the provider be adapted to a proxy? Set baseURL to the proxy's URL prefix.
The apiKey setting supplies the credential sent in the Authorization header. When it is not supplied, the provider reads FIREWORKS_API_KEY.
Follow-up: What happens if a deployment needs custom request behavior? Supply a fetch implementation in the provider settings.
The returned provider is callable with a model identifier, producing a Fireworks model for use with AI SDK operations. The factory itself configures the provider rather than generating model output.
Follow-up: Which other provider settings can be customized? baseURL, headers, and fetch are also documented options.
fireworks@ai-sdk/fireworksbaseURLapiKeyheadersfetch