Custom authentication
Use custom credentials instead of relying on the default environment variable.
AI Tools · Function
Creates a customized Groq provider for the Vercel AI SDK. Configure credentials and the API endpoint, then call the provider with a Groq model identifier.
createGroq builds a Groq provider instance from optional settings. The resulting provider can be called with a model identifier to obtain a language model, while configuration can customize credentials and the API endpoint prefix.
createGroq(options?: GroqProviderSettings): GroqProvider| Name | Type | Description |
|---|---|---|
options | GroqProviderSettings | Optional provider settings, including apiKey and baseURL. |
A Groq provider instance that can create language models from model identifiers.
import { createGroq } from '@ai-sdk/groq';
const groq = createGroq({
apiKey: process.env.GROQ_API_KEY,
});
const model = groq('llama-3.1-8b-instant');Creates a configured Groq provider and selects a model from it.
Use custom credentials instead of relying on the default environment variable.
Route Groq-compatible requests through a proxy or alternate endpoint.
Create separate provider instances with different settings.
groq@ai-sdk/groqbaseURLapiKey