capabilities.work

AI Gateway Discover Model Then Complete

A 2-step recipe with Vercel. We can help you get access.

Recipe · 2 steps

AI Gateway Discover Model Then Complete

with Vercel

Verify a model is in the gateway catalog, then create a chat completion.

  1. List all models reachable through the gateway to confirm availability.
  2. Create a chat completion against the confirmed model.
What you'll need to have ready
  • apiKey: Vercel AI Gateway API key (AI_GATEWAY_API_KEY) used as a Bearer token.
  • model: Model id in 'provider/model-name' form (e.g. anthropic/claude-opus-4.6).
  • prompt: The user message to send to the model.
  • maxTokens: Optional maximum number of tokens to generate.
For your developer

Arazzo workflow vercel:discoverModelThenComplete, 2 operations: listModels → createChatCompletion. Specs on APIs.io.