Category
SDK API
AI SDK functions with working examples
generateText( )
Text and structured data generation with Output.object()
streamText( )
Streaming text and structured data with Output.object()
generateImage( )
Image generation examples
generateSpeech( )
Speech synthesis examples
transcribe( )
Audio transcription examples
tool( )
AI SDK tool API examples and patterns
Agent( )
AI SDK agent API examples and patterns
evaluate( )
Typed evaluation with experimental_evaluate and Jev
All SDK API patterns
Browse every production-ready pattern in SDK API.


AI SDK Gemini Flash Text
Generate text and analyze market research using Google's Gemini 2.5 Flash. Includes interactive charts and data visualization.


Claude Structured Output
Generate structured output from AI prompts using Anthropic Claude. Create typed data with generateText and Output.object().


Gemini Structured Output
Generate structured output from AI prompts using Google Gemini. Create typed data with generateText and Output.object().


OpenAI Structured Output
Generate structured output from AI prompts using OpenAI. Create typed data with generateText and Output.object().


Generate Text
Generate text from prompts using AI. Simple interface with character counting and response rendering.


Streaming Structured Output
Stream structured output from AI prompts in real-time using streamText with Output.object(). Generate typed data with useObject and live rendering.


Stream Text
Stream text responses from AI prompts in real-time. Includes character counting and live response rendering with useCompletion.


Generate Image (Flux)
Generate images from text prompts using Flux through the Vercel AI Gateway. Fast, high-quality image generation with one API key.


Generate Image (Google Gemini)
Generate images from text prompts using Google Gemini's image model.


Generate Image (Grok Imagine)
Generate images from text prompts using xAI Grok Imagine through the Vercel AI Gateway.


Generate Image (OpenAI)
Generate images from text prompts using OpenAI's GPT Image 2.5 Sunburst through the Vercel AI Gateway.


Generate Speech (ElevenLabs)
Convert text to speech using ElevenLabs API. Includes multiple voices and high-quality audio generation.


Generate Speech (OpenAI)
Convert text to speech using OpenAI's API. Includes multiple voices, speed control, and real-time playback for voiceovers and accessibility.


Transcribe Audio (ElevenLabs)
Transcribe audio files using ElevenLabs API. Includes real-time transcription and language detection.


Transcribe Audio (OpenAI)
Transcribe audio files using OpenAI's API. Includes real-time transcription and language detection.


HIL Needs Approval
Demonstrate tool approval with async generators. Includes real-time feedback, approval workflows, and interactive management.


HIL Tool Approval Basic
Chat assistant with human approval workflows for safe tool execution.


Scrape - Cheerio (lightweight)
Scrape websites using Cheerio's fast HTML parser. Includes URL scraping, website crawling, and content extraction without external API costs.


Scrape - Jina AI (advanced)
Scrape websites using Jina AI's reader service with JavaScript rendering. Includes URL scraping, website crawling, and content extraction with AI-powered parsing.


Scrape - Markdown.new (free)
Scrape websites using Cloudflare's markdown.new service. Extract clean markdown content from any URL. No API key required.


Search - Exa AI (robust)
Search the web using Exa's semantic API and real-time crawling. Includes URL search, content extraction, Wikipedia, Reddit, and news search tools.


Search - Firecrawl (robust)
Search the web using Firecrawl's API and real-time crawling. Includes URL search, content extraction, Wikipedia, Reddit, and news search tools.


Code Mode Compare
See if stock covers an open order. The model writes one program that calls both lookups and subtracts.


Tool API Context
Pass arbitrary context from generateText/streamText to tool execution via experimental_context. Access context in tool execute functions for dynamic behavior.


Dynamic Tool
Create dynamic tools with runtime-generated schemas using dynamicTool. Demonstrates unit conversion tools where schema adapts based on conversion type (temperature, length, weight, currency) and supports dynamic model selection.


Tool Input Lifecycle Hooks
Explore tool input lifecycle hooks: onInputStart, onInputDelta, and onInputAvailable. See how to track tool input generation in real-time during streaming.


Preliminary Tool Results
Return preliminary tool results using async iterables. Stream status updates during tool execution before the final result is available.


Tool Call Repair
Repair invalid tool calls using experimental_repairToolCall. Fix schema validation errors without requiring additional steps that pollute message history.


Call Options: prepareCall
Dynamically configure one ToolLoopAgent per request with callOptionsSchema and prepareCall. A customer-support agent rewrites instructions, gates tools, tunes reasoning effort, and injects RAG context based on account tier and urgency.


Tool Context: experimental_context
Inject request-scoped context (user identity, database handles, session) into ToolLoopAgent tools via experimental_context, so the model never supplies sensitive identity in tool inputs.


Loop Control: stopWhen
Demonstrate ToolLoopAgent loop control with stopWhen. Covers stepCountIs, hasToolCall, combined conditions, and a custom StopCondition with step timeline visualization.


PrepareStep: Trim Message History
Demonstrate ToolLoopAgent prepareStep for trimming long message history. Pre-seeded 24-message conversation shows context compression on the first run with per-step trim telemetry.


Structured Agent Output: Output.array
Demonstrate structured agent outputs using ToolLoopAgent with Output.array. Returns structured array output with element schema for predictable, type-safe responses.


Structured Agent Output: Output.choice
Demonstrate structured agent outputs using ToolLoopAgent with Output.choice. Constrain agent outputs to predefined choices for predictable, type-safe responses.


Jev Action Gate
One command at a time. It passes the gate only when a Jev boolean clears 0.90.


Jev Best-of-N Judge
Three prepared replies sit on the table. A Jev choice lifts the winner only when its probability clears 0.70.


Jev Composite Scorecard
Score a pull request description with three atomic Jev score questions, then combine the answers with weights in code.


Jev Confidence Router
Four trays are on the table. A message flies to a team only when confidence and the selected probability both clear their floors.


Jev Email Tags
Tag a closed inbox with one Jev boolean per tag. A stamp lands only when its probability clears a floor.


Jev Evals
Run a rubric eval suite with jev-evals: one Jev call per case answers every rubric, and a baseline diff catches fractional regressions.


Jev Infinite FAQ
A FAQ whose last row is a live ask field. Jev opens a canned answer when it matches, or a short grounded answer becomes another row.


Jev Loop Breaker
Look up facts one step at a time. Stop when Jev is at least 90% sure the notes answer the task, or after 3 lookups.


Jev Memory
Long-term agent memory with three Jev gates. Keep durable facts, recall what fits a token budget, and evict what went stale. Nothing is rewritten.


Jev Output Verifier
Write an answer, then show it only if Jev is at least 90% sure it actually answers the question. If not, rewrite once.


Jev Search Filter
Filter a closed catalog with one Jev boolean per item. Matches rise out of the pile when their probability clears a floor.


Jev Sub-agent Delegation
Pick one specialist with a Jev choice, then run only that agent when confidence and selected probability both clear their floors.


Jev Table Query
Filter or sort a closed table with one Jev question per row. A column name never leaves the app.
Explore related categories
You’ve reached the end of SDK API.



