AI Gateway

OpenResponses API with AI Gateway
SDKs & APIs

AI Gateway supports the OpenResponses API specification, an open standard for AI model interactions. OpenResponses provides a unified interface across providers with built-in support for streaming, tool calling, reasoning, and multi-modal inputs.
OpenResponses API
The OpenResponses-compatible API is available at:
The OpenResponses API supports the same authentication methods as the main AI Gateway:
https://ai-gateway.vercel.sh/v1
Although this Website may be linked to other websites, we are not, directly or indirectly, implying any approval.
- API key: Use your AI Gateway API key with the
Authorization: Bearer
header - OIDC token: Use your Vercel OIDC token with the
Authorization: Bearer
header
You only need to use one of these forms of authentication. If an API key is specified it will take precedence over any OIDC token, even if the API key is invalid.
Supported features
The OpenResponses API supports the following features:
- Text generation - Generate text responses from prompts
- Streaming - Stream tokens as they're generated
- Tool calling - Define tools the model can call
- Structured outputs - Constrain the response to a JSON schema
- Reasoning - Control how much a model thinks before answering
- Images - Send images for analysis
- Advanced - Configure model fallbacks and provider-specific settings
Getting started
Generate a text response:
TypeScript
constapiKey=process.env.AI_GATEWAY_API_KEY;
method:'POST',
constresponse=awaitfetch('https://ai-gateway.vercel.sh/v1/responses', {
input: [
body:JSON.stringify({
},
{
content:'What is the capital of France?',
'Content-Type':'application/json',
role:'user',
headers: {
type:'message',
model:'anthropic/claude-opus-5',
if (block.type ==='output_text') console.log(block.text);
}),
},
],
});
Parameters
- model (string): The model ID in provider/model format (e.g., openai/gpt-6-astra, anthropic/claude-opus-5)
- input (array): Array of message objects containing type, role, and content fields
- stream (boolean): Stream the response. Defaults to false
- temperature (number): Controls randomness. Range: 0-2
- top_p (number): Nucleus sampling. Range: 0-1
- max_output_tokens (integer): Maximum tokens to generate
- tools (array): Tool definitions for function calling
- tool_choice (string): Tool selection mode: auto, required, or none
- reasoning (object): Reasoning configuration with effort level
- providerOptions (object): Provider-specific options for gateway configuration
This example shows how to combine multiple parameters to control the model's behavior, set up fallbacks, and enable reasoning.
role:'user',
stream:true,// stream tokens as generated
body:JSON.stringify({
model:'anthropic/claude-opus-5',// provider/model format
headers: {
input: [
],
},
max_output_tokens:500,// limit response length
method:'POST',
reasoning: {
gateway: {
type:'message',
providerOptions: {
models: ['anthropic/claude-opus-5','openai/gpt-6-astra'],// fallbacks
}),
},
},
});
- 400 Bad Request - Invalid request parameters
- 401 Unauthorized - Invalid or missing authentication
- 403 Forbidden - Insufficient permissions
- 404 Not Found - Model or endpoint not found
- 429 Too Many Requests - Rate limit exceeded
- 500 Internal Server Error - Server error
You can reach our customer support team by emailing info@yourcompany.example.com, calling +1 555-555-5556, or using the live chat on our website. Our dedicated team is available 24/7 to assist with any inquiries or issues.
We’re committed to providing prompt and effective solutions to ensure your satisfaction.
We offer a 30-day return policy for all products. Items must be in their original condition, unused, and include the receipt or proof of purchase. Refunds are processed within 5-7 business days of receiving the returned item.
{
"error": {
}
Last updated September 8, 2026
"type":"invalid_request_error",
"code":"missing_parameter"
Cross-link map: OpenResponses API with AI Gateway (/docs/ai-gateway/sdks-and-apis/openresponses)From the Vercel docs graph (built 2026-09-21T05:26:59.511Z), spanning vercel.com docs + KB, nextjs.org, ai-sdk.dev, and other Vercel documentation sites. Full graph as JSON: https://vercel.com/docs/graph.jsonSemantically closest pagesOpenAI Responses API with AI Gateway — Use the OpenAI Responses API with AI Gateway to generate text, call tools, stream tokens, and more across any supportedOpenResponses Text Generation with AI Gateway — Generate text responses using the OpenResponses API through AI Gateway.OpenResponses Configuration with AI Gateway — Configure provider routing, fallbacks, and restrictions using the OpenResponses API through AI Gateway.OpenAI Responses Text Generation with AI Gateway — Generate text responses with the OpenAI Responses API through AI Gateway.OpenResponses API now supported on Vercel AI GatewayThis page links to (8)AI Gateway Authentication and BYOK — Authenticate AI Gateway requests with API keys or OIDC tokens, and configure bring your own key \(BYOK\) credentials forOpenResponses Configuration with AI Gateway — Configure provider routing, fallbacks, and restrictions using the OpenResponses API through AI Gateway.OpenResponses Images and PDFs with AI Gateway — Send images and PDF documents for analysis using the OpenResponses API through AI Gateway.OpenResponses Reasoning with AI Gateway — Control how much a reasoning model thinks before answering with the OpenResponses API through AI Gateway.OpenResponses Streaming with AI Gateway — Stream responses token by token using the OpenResponses API through AI Gateway.OpenResponses Structured Outputs with AI Gateway — Request schema-constrained JSON with OpenResponses through AI Gateway, and handle provider support and response validatiOpenResponses Text Generation with AI Gateway — Generate text responses using the OpenResponses API through AI Gateway.OpenResponses Tool Calling with AI Gateway — Define tools the model can call using the OpenResponses API through AI Gateway.Pages that link here (18)By site: vercel-changelog (1) · vercel-web (1) · vercel-docs (16)From vercel-changelogService tiers now available on AI GatewayFrom vercel-webZero Data Retention on AI GatewayFrom vercel-docsAI Gateway FAQ — Answers to common questions about AI Gateway, including request errors, pricing and markup, SDK and API compatibility, mAI Gateway Text Generation Quickstart — Generate and stream text responses using AI Gateway.AI Gateway Audio Input — Analyze recorded audio with AI Gateway, compare audio input with transcription and realtime voice, and choose a supporteAI Gateway File and PDF Input — Send PDFs and documents to AI Gateway models with examples for each supported SDK and API format.AI Gateway Video Input — Analyze video clips with AI Gateway using AI SDK 7, Python, Chat Completions, and Responses / OpenResponses.AI Gateway SDKs and APIs — Connect to AI Gateway with the AI SDK, Python, REST, or compatible OpenAI, Anthropic Messages, OpenResponses, and CohereAI SDK with AI Gateway — Build AI-powered TypeScript applications using the AI SDK with AI Gateway for unified access to 200+ models.OpenResponses Configuration with AI Gateway — Configure provider routing, fallbacks, and restrictions using the OpenResponses API through AI Gateway.OpenResponses Images and PDFs with AI Gateway — Send images and PDF documents for analysis using the OpenResponses API through AI Gateway.OpenResponses Reasoning with AI Gateway — Control how much a reasoning model thinks before answering with the OpenResponses API through AI Gateway.OpenResponses Streaming with AI Gateway — Stream responses token by token using the OpenResponses API through AI Gateway.OpenResponses Structured Outputs with AI Gateway — Request schema-constrained JSON with OpenResponses through AI Gateway, and handle provider support and response validatiOpenResponses Text Generation with AI Gateway — Generate text responses using the OpenResponses API through AI Gateway.OpenResponses Tool Calling with AI Gateway — Define tools the model can call using the OpenResponses API through AI Gateway.OpenAI Responses Reasoning with AI Gateway — Control how much a model thinks before answering with the OpenAI Responses API through AI Gateway.AI Gateway REST API Reference — Reference for AI Gateway REST endpoints: models, usage, generations, and reporting.
"message":"Invalid request: missing required parameter 'model'",
"param":"model",
Was this helpful?