groq
Package
Section titled “Package”@ai-sdk/groq
Factories
Section titled “Factories”AIProviders.groq
Capabilities
Section titled “Capabilities”- Language
- Transcription
JSON output with function tools
Section titled “JSON output with function tools”Groq can combine .json(schema: ...) with application function tools using a collision-safe synthetic JSON response tool. Its arguments become JSON text while real application calls retain their lifecycle. Generation and streams omit the synthetic call and conversational prose. An explicit application tool choice is preserved; none selects the response tool. Portable reasoning max maps to high.
Forward-compatible browser search
Section titled “Forward-compatible browser search”Browser search stays enabled for unknown model IDs, alongside ordinary function tools. Known unsupported models, including Gemma, legacy Llama/Mixtral, Kimi K2 and Qwen entries, omit browser search and report a model-specific warning. New compatible model names no longer require a Swift package update merely to retain the requested tool.
Generated content order
Section titled “Generated content order”Unary generation places the separate reasoning block before text, followed by function tool calls. This keeps result.content in the same reasoning-before-answer order as streamed output.
Groq mirrors upstream 4.0.70: GROQ_API_KEY, custom base URL and headers, versioned user-agent suffix, callable/language aliases, transcription aliases, chat /openai/v1/chat/completions, transcription /openai/v1/audio/transcriptions, OpenAI-compatible prompt conversion, Qwen/gpt-oss reasoning content, top-level reasoning to reasoning_effort mapping with providerOptions precedence and compatibility warnings, Groq provider options, browser_search provider tool gating, service tiers, structured outputs, stream usage/metadata, tool-call streaming validation, transcription multipart options/validation, plain-text responses, and words-to-segments fallback, response metadata, Groq error schema, and unsupported embedding/image families. Current parity makes top-level reasoning: none model-aware, clamps reasoning-adjusted text usage, preserves complete usage, and normalizes provider stream errors. ProviderV4 type names, ESM-only packaging, Node 22 engines, TypeScript option export renames, optional JS headers config, and workflow serialization helpers are JS-only upstream concerns. The 2026-09-27 pass rejects successful responses whose choices array is empty with the exact structural response error. The 2026-10-11 pass: JSON schema with tools uses a collision-safe response tool and converts its arguments to text without leaking synthetic tool events; common max effort maps to high. The 2026-10-18 pass: Browser search is enabled for unknown/future IDs while the published explicit legacy exclusion set retains unsupported-tool warnings. The 2026-10-23 pass: Generated reasoning precedes text and tool calls.
Factory argument requirements are defined by the public Swift factory signatures. Use Public symbols when you need the exact initializer or factory declaration.
Return to the provider matrix.