Skip to main content
Vercel AI Gateway logo
  • Category: ai models
  • Auth: API_KEY
  • Composio-managed OAuth available? N/A
  • Tools: 22
  • Triggers: 0
  • Slug: VERCEL_AI_GATEWAY
  • Version: 00000000_00

Tools

Slug: VERCEL_AI_GATEWAY_COMPACT_RESPONSECompact a long OpenAI Responses conversation into replayable context through Vercel AI Gateway. This endpoint only supports models routed to OpenAI and does not fail over to other providers; model compatibility is checked by the provider rather than by this action.

Input Parameters

string
required
Conversation to compact as text or OpenAI Responses input items. It must include at least one user message.
string
required
OpenAI model ID in provider/model form. This endpoint only supports models routed to OpenAI.
string
Optional system-level instructions included in the compacted context.
string ("auto" | "default" | "flex" | "priority")
OpenAI service tier requested for the compaction operation.
string
Stable key used to identify related cached prompts.
string
Previous OpenAI response whose conversation state should be compacted.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_COUNT_MESSAGE_TOKENSEstimate input tokens for Anthropic-format messages, system content, and tools before sending a model request through Vercel AI Gateway.

Input Parameters

string
required
Gateway model ID to use for tokenization.
array
Optional Anthropic tool definitions included in the count, preserving their provider-defined input schemas.
string
Optional Anthropic system text or provider-defined system content blocks included in the count.
array
required
Anthropic-format messages whose input tokens should be counted. Message content may contain provider-defined text, image, tool-use, or tool-result blocks.
object
Optional Anthropic extended-thinking configuration included when calculating the request’s input-token usage.
object
Optional Anthropic tool-selection configuration, such as auto, any, or a named tool, included in the token count.
object
Optional top-level Anthropic prompt-cache configuration, including automatic cache behavior and provider-supported expiration settings.
object
Optional Anthropic output configuration, including provider-defined structured-output format settings that affect the token count.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_CREATE_ANTHROPIC_MESSAGECreate one non-streaming Anthropic Messages-compatible result through Vercel AI Gateway, with multimodal content, tools, extended thinking, and routing controls.

Input Parameters

string
required
Gateway model ID in provider/model form.
array
Anthropic tool definitions, including built-in tools such as web search.
integer
Optional number of highest-probability tokens considered at each step.
number
Optional nucleus-sampling probability between 0 and 1.
string
Optional Anthropic system text or provider-defined system content blocks.
array
required
Anthropic-format messages. Content may be text or provider-supported text, image, document, tool-use, or tool-result blocks.
object
Anthropic request metadata, such as an opaque user identifier.
object
Anthropic extended-thinking configuration supported by the selected model.
integer
required
Maximum number of tokens to generate before stopping.
number
Sampling temperature between 0 and 1.
object
Anthropic tool-selection controls, such as auto, any, or a named tool.
string
Anthropic service tier requested for this message, when supported.
array
Custom text sequences that stop generation.
object
Gateway routing and provider-specific options.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_CREATE_CHAT_COMPLETIONCreate one non-streaming OpenAI Chat Completions-compatible result through Vercel AI Gateway, with multimodal messages, tools, structured output, fallback models, and routing controls.

Input Parameters

string
One or more sequences at which generation should stop.
string
required
Gateway model ID in provider/model form.
array
OpenAI-format tool definitions available to the model.
number
Optional nucleus-sampling probability between 0 and 1.
array
Fallback Gateway model IDs to try in order if the primary model fails.
array
required
OpenAI-format conversation messages. Content may be text or an array of provider-supported text, image, file, audio, or tool-result parts.
integer
Maximum number of tokens to generate.
number
Sampling temperature between 0 and 2.
string
Whether and how the model may select a supplied tool.
object
OpenAI response format, including text, JSON, or JSON Schema output.
number
Penalty for tokens that already appear in the generated text.
object
Gateway routing and provider-specific options.
number
Penalty for tokens based on their existing frequency.
string
Opaque end-user identifier used by AI Gateway safety controls.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_CREATE_EMBEDDINGSGenerate OpenAI-compatible vector embeddings through Vercel AI Gateway for text or token inputs, with optional dimensions and routing controls.

Input Parameters

string
Optional opaque end-user identifier for the embedding request.
string
required
Text, a batch of texts, one token array, or a batch of token arrays to embed, as accepted by the selected OpenAI-compatible model.
string
required
Gateway embedding model ID in provider/model form.
integer
Requested embedding dimensions; AI Gateway maps this across providers.
string ("float" | "base64")
Whether embeddings are returned as float arrays or base64 strings.
object
Gateway routing and provider-specific options.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_EDIT_IMAGESCreate edited images from up to 16 HTTPS or base64 data-URL source images and a text instruction. Uses the non-streaming JSON image-edit route only.

Input Parameters

string
Requested output dimensions when supported, such as 1024x1024.
string
Stable end-user identifier for provider abuse monitoring.
string
required
Gateway image model ID that supports image editing.
array
required
Source images referenced only by HTTPS URL or base64 data URL.
string
required
Instructions describing how to edit the source images.
string
Provider-supported output quality, such as high, medium, or low.
string ("auto" | "transparent" | "opaque")
Background behavior for models that support this option.
string
Provider-supported image moderation setting.
integer
Number of edited images to generate, subject to the model’s limit.
string ("png" | "jpeg" | "webp")
Requested output image encoding.
string
Provider-supported control for preserving source-image details.
object
Gateway routing and provider-specific image options.
integer
Compression level from 0 to 100 for JPEG or WebP output.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_EVALUATE_STATEEvaluate one shared state against one or more typed choice, score, or boolean questions using an AI Gateway evaluation model. Returns structured answers, token usage, and gateway metadata rather than generated prose.

Input Parameters

string
required
Gateway evaluation model ID.
string
required
Shared state to evaluate as any recursively nested JSON value.
object
required
Nonempty map of question IDs to typed choice, score, or boolean questions. Answer keys match these IDs.
object
Optional AI Gateway routing and provider controls, including zero data retention or provider restrictions.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GENERATE_IMAGESGenerate one or more images from a text prompt through an image-only Vercel AI Gateway model. Returns a completed non-streaming JSON response.

Input Parameters

string
Requested image dimensions when supported, such as 1024x1024.
string
required
Gateway image model ID in provider/model form.
string
required
Text description of the image to generate.
string
Provider-supported output quality, such as high, medium, or low.
integer
Number of images to generate, subject to the selected model’s limit.
string ("b64_json" | "url")
Image representation requested from compatible models.
object
Gateway routing and provider-specific image options.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GENERATE_RESPONSEGenerate one non-streaming OpenAI Responses-compatible result through AI Gateway, with optional instructions, tools, structured output, reasoning, and routing controls. Inspect status because a successful HTTP response may still be incomplete.

Input Parameters

object
Text output controls, including an OpenAI Responses structured-output format.
string
required
User input text or OpenAI Responses input items, including prior messages or multimodal content.
string
required
Gateway model ID in provider/model form.
boolean
Whether the provider should store the response for later retrieval.
array
OpenAI Responses tool definitions available to the model.
number
Optional nucleus-sampling probability between 0 and 1.
string
Set to auto to let AI Gateway add provider-appropriate cache markers.
object
Up to 16 string key-value pairs for tracking this response.
string ("5m" | "1h")
Automatic prompt-cache lifetime; requires caching set to auto.
object
Reasoning controls supported by the selected model, such as effort or summary.
string ("auto" | "disabled")
Long-input truncation strategy: auto or disabled.
number
Sampling temperature accepted by the selected model.
string
How the model may choose from supplied tools: none disables tool calls, auto lets the model decide, required forces a tool call, and an OpenAI Responses tool-choice object selects a specific tool.
string
System-level instructions for this response.
array
Optional subset of supplied tool names the model may call.
number
Optional penalty for tokens that already appear in the generated text.
string
Stable key used to identify related cached prompts.
object
Gateway routing and provider-specific options.
number
Optional penalty based on how frequently tokens already appear.
integer
Optional maximum generated tokens, including reasoning tokens.
integer
Number of leading input items that remain byte-stable for cache anchoring.
boolean
Whether the model may call multiple tools in one turn.
string
Prior response ID to continue when the selected provider supports response chaining.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GENERATE_SPEECHGenerate spoken audio from text through a Vercel AI Gateway speech model. Returns completed base64 audio in JSON; streaming output is not supported.

Input Parameters

string
required
Text to convert into spoken audio.
string
required
Gateway speech model ID in provider/model form.
number
Requested playback speed when supported by the model.
string
Model-supported voice, such as alloy.
string
Language of the input text when the model accepts an explicit language.
string
Directions for speaking style, tone, or pacing when supported.
string
Requested audio encoding, such as mp3 or wav.
object
Provider-specific speech options.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GET_CREDIT_BALANCEReturn the connected team’s remaining AI Gateway credit balance and lifetime credit usage in USD.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GET_GENERATIONLook up cost, token usage, provider routing, latency, and finish details for one completed Vercel AI Gateway generation.

Input Parameters

string
required
Generation ID returned by inference. It starts with gen_ followed by a 26-character ULID.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GET_MODELReturn detailed capabilities, modalities, limits, tags, and pricing for one exact Gateway model ID.

Input Parameters

string
required
Exact provider/model ID to retrieve.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GET_MODEL_ENDPOINTSCompare provider endpoints serving one Vercel AI Gateway model, including limits, pricing, caching, availability, throughput, and latency.

Input Parameters

string
required
Exact model ID in provider/model form.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_GET_SPEND_REPORTQuery aggregated Vercel AI Gateway spend and token usage. This endpoint requires a Pro or Enterprise plan, and each query costs $5 per 1,000 queries.

Input Parameters

string
One or more comma-separated reporting tags to match.
string
Only include this model in creator/model-name form.
string
Only include requests attributed to this user ID.
string
required
Inclusive UTC end date in YYYY-MM-DD format.
string ("day" | "user" | "model" | "tag" | "provider" | "credential_type" | "zero_data_retention" | "api_key_name")
Aggregation dimension. Defaults to day when omitted.
string
Only include requests served by this provider.
string ("day" | "hour")
Time granularity when group_by is day. Defaults to day.
string
Stable API key ID to filter by, or self for the API key authenticating this request.
string
required
Inclusive UTC start date in YYYY-MM-DD format.
string ("any" | "all")
Whether requests must match any or all supplied tags. Defaults to any.
string ("byok" | "system")
Only include BYOK or AI Gateway system-credential requests.
boolean
Filter by whether Zero Data Retention was requested.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_LIST_MODEL_CATALOGList AI Gateway model-to-provider routes and capability tags, with bounded local filtering by model text, provider, or tag.

Input Parameters

string
Case-insensitive exact provider capability tag to include.
string
Case-insensitive text to match against model slugs, provider names, or provider model IDs.
string
Case-insensitive exact provider name to include.
integer
Maximum matching catalog models to return (1-100).

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_LIST_TYPESAFE_MODELSList evaluation models available through AI Gateway’s TypeSafe-compatible API, including each accepted model name, description, and release date.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_RERANK_OBJECT_DOCUMENTSRank structured object documents by relevance through the Cohere v1 route, using selected rank fields and optionally returning each source document.

Input Parameters

string
required
Gateway reranking model ID.
string
required
Query against which the documents should be ranked.
integer
Maximum highest-ranked results to return; cannot exceed the number of documents.
array
required
Structured documents to rank; each result index refers to this array. Use rank_fields to identify the text-bearing fields.
array
Structured document fields to rank, in priority order. When omitted, the provider defaults to the text field.
object
Gateway routing and provider-specific options.
boolean
Set true to include each original structured document in the results. When omitted, the provider default is false.
integer
Optional per-document token cap.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_RERANK_TEXT_DOCUMENTSRerank string documents through the current Cohere v2 compatibility endpoint. Unlike the v1 action, this action accepts text strings only and does not support object documents, rank_fields, or return_documents.

Input Parameters

string
required
Gateway reranking model ID.
string
required
Query against which the documents should be ranked.
integer
Maximum highest-ranked results to return; defaults to all documents.
array
required
Text-only documents to rank using the Cohere v2 compatibility API.
object
AI Gateway routing options, including providerOptions.gateway controls.
integer
Optional per-document token cap.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_SEARCH_MODELSSearch the AI Gateway model catalog by text, model type, and tags, returning capability and pricing metadata for matching models.

Input Parameters

string
Case-insensitive text to match against model ID, name, owner, or description.
string
Exact catalog model type to include, such as language, embedding, image, or reranking.
integer
Maximum matching models to return after scanning the complete catalog (1-100).
array
Tags every returned model must have, such as free, reasoning, or tool-use.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_TRANSCRIBE_AUDIOTranscribe base64-encoded recorded audio through a Vercel AI Gateway transcription model. Returns one completed JSON transcript, not a live stream.

Input Parameters

string
required
Base64-encoded recorded audio bytes.
string
required
Gateway transcription model ID in provider/model form.
string
required
MIME type of the encoded audio, such as audio/mpeg or audio/wav.
object
Provider-specific transcription options.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: VERCEL_AI_GATEWAY_TYPESAFE_EVALUATEEvaluate one shared state through AI Gateway’s TypeSafe-compatible System One API. Use this compatibility action for TypeSafe noul, choice, and score request shapes; use Evaluate State for new integrations.

Input Parameters

string
required
TypeSafe evaluation model name accepted by AI Gateway.
string
required
Shared state to evaluate as any recursively nested JSON value.
object
required
Nonempty map of question IDs to TypeSafe noul, choice, or score questions. Answer keys match these IDs.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not