Skip to content
Docs

AI Gateway Model Modalities

Modalities are the kinds of input and output models work with. Through AI Gateway you can generate text, images, and video, transcribe and synthesize speech, hold realtime voice conversations, create embeddings, rerank documents, and answer typed questions about state, all through a unified API so you don't need separate integrations for each provider. For cross-cutting abilities like reasoning and web search, see Models & Providers.

For image understanding, documents, recorded audio, video analysis, and function calling, see Inputs & Tools.

  • Text apps: Generate and stream text for chat, content, and agents with Text Generation
  • Visual content apps: Generate product images, marketing assets, or UI mockups with Image Generation
  • Video content: Create videos from text prompts, images, or video input with Video Generation
  • Voice agents: Build low-latency, two-way voice conversations with Realtime
  • Transcription: Turn recorded audio into text with Speech to Text
  • Spoken audio: Generate voiceovers and spoken responses from text with Text to Speech
  • Semantic search: Generate vector embeddings for search, similarity matching, and RAG with Embeddings
  • Improved retrieval: Re-score candidate documents by relevance for better RAG results with Reranking
  • Structured decisions: Answer typed questions about shared state with Decision
ModalityWhat it doesKey features
Text GenerationGenerate and stream textHundreds of models, streaming, tool calling, structured output
Image GenerationCreate images from text promptsMulti-provider support, edit existing images, multiple output formats
Video GenerationCreate videos from text, images, or videoText-to-video, image-to-video, video-to-video, resolution and duration control
RealtimeHold live, two-way voice conversationsLow-latency speech-to-speech, browser and Node.js, session config and limits
Speech to TextTranscribe recorded audio into textBatch and streaming transcription, timestamped segments, language detection
Text to SpeechGenerate spoken audio from textGoogle, Microsoft, and OpenAI voices, multiple formats, speed and tone control
EmbeddingsGenerate vector representations of textSemantic search, similarity matching, RAG pipelines
RerankingRe-score documents by relevanceImprove RAG retrieval accuracy, multi-provider support
DecisionAnswer typed questions about stateBoolean, choice, and score answers, many questions per request

Generate and stream text from hundreds of models through a single API. Text is the default modality, with support for tool calling and structured output.

import { generateText } from 'ai';
 
const { text } = await generateText({
  model: 'openai/gpt-6-astra',
  prompt: 'What is the capital of France?',
});

See the Text Generation docs for streaming, tool calling, and structured output.

Generate images using AI models through a single API. Requests route to the best available provider, with authentication and response formatting handled automatically.

import { gateway } from '@ai-sdk/gateway';
import { generateImage } from 'ai';
 
const { image } = await generateImage({
  model: gateway.imageModel('openai/gpt-image-2'),
  prompt: 'A serene mountain landscape at sunset',
});

Supported providers include OpenAI (GPT Image), Google (Nano Banana), and multimodal LLMs with image capabilities. See the Image Generation docs for implementation details.

Generate videos from text prompts, images, or video input using AI models through a single API. Control resolution, duration, aspect ratio, and audio generation across providers.

import { experimental_generateVideo as generateVideo } from 'ai';
 
const { videos } = await generateVideo({
  model: 'google/veo-3.1-generate-001',
  prompt: 'A serene mountain landscape at sunset with clouds drifting by',
  aspectRatio: '16:9',
  resolution: '1920x1080',
  duration: 8,
});

Supported providers include Google (Veo 3.1), KlingAI (motion control), and Wan. See the Video Generation docs for implementation details.

AI Gateway supports audio understanding, transcription, speech generation, and realtime voice. Use this table to pick the one that matches what you have and what you want to produce:

CapabilityInput and outputUse it forMode
Audio InputRecorded audio and a question in, text outSummarizing speech or asking questions about a recordingSingle response or streamed text
Speech to TextRecorded audio in, text outTranscribing files you already have, such as voice notes, call recordings, and podcastsBatch, single response
Text to SpeechText in, audio file outVoiceovers, audio versions of written content, and spoken responsesBatch, single response
RealtimeLive audio in and outTwo-way voice agents and live conversationStreaming, low-latency session

Speech to Text and Text to Speech process recorded or generated audio in a single request. Realtime handles live conversation, so reach for it when you need a back-and-forth voice session rather than a transcript or a finished audio file.

Generate vector embeddings for semantic search, similarity matching, and RAG, then re-score candidate documents by relevance to improve retrieval accuracy. See the Embeddings docs and Reranking docs for implementation details.

Ask typed questions about shared state and get structured answers back: boolean probabilities, a choice from a named set, or a score along an ordered scale. Many questions can be answered in one request. See the Decision docs for implementation details.

For cross-cutting abilities, see Models & Providers. For monitoring and spend, see Observability and Spend. For data privacy and governance, see Security and Compliance.

Last updated October 5, 2026

Was this helpful?

supported.