Vercel · Arazzo Workflow

Vercel AI Gateway Discover Model Then Complete

Version 1.0.0

List available models, confirm the requested one is present, then run a chat completion.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub AI GatewaysGatewaysObservabilityWebhookArazzoWorkflows

Provider

vercel

Workflows

discoverModelThenComplete
Verify a model is in the gateway catalog, then create a chat completion.
Lists gateway models, branches on whether the requested model is available, and on success creates a chat completion returning the assistant message and token usage.
2 steps inputs: apiKey, maxTokens, model, prompt outputs: finishReason, reply, totalTokens
1
listModels
List all models reachable through the gateway to confirm availability.
2
complete
Create a chat completion against the confirmed model.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Vercel AI Gateway Discover Model Then Complete
  summary: List available models, confirm the requested one is present, then run a chat completion.
  description: >-
    A guarded chat-completion flow for the Vercel AI Gateway. The workflow first
    lists the models reachable through the gateway and confirms the requested
    model id appears in the catalog, then issues a chat completion against it. This
    prevents spending a request against a model the account cannot reach. Each step
    inlines its request and documents the success status.
  version: 1.0.0
sourceDescriptions:
- name: chatApi
  url: ../openapi/vercel-chat-api-openapi.yml
  type: openapi
- name: modelsApi
  url: ../openapi/vercel-models-api-openapi.yml
  type: openapi
workflows:
- workflowId: discoverModelThenComplete
  summary: Verify a model is in the gateway catalog, then create a chat completion.
  description: >-
    Lists gateway models, branches on whether the requested model is available,
    and on success creates a chat completion returning the assistant message and
    token usage.
  inputs:
    type: object
    required:
    - apiKey
    - model
    - prompt
    properties:
      apiKey:
        type: string
        description: Vercel AI Gateway API key (AI_GATEWAY_API_KEY) used as a Bearer token.
      model:
        type: string
        description: "Model id in 'provider/model-name' form (e.g. anthropic/claude-opus-4.6)."
      prompt:
        type: string
        description: The user message to send to the model.
      maxTokens:
        type: integer
        description: Optional maximum number of tokens to generate.
  steps:
  - stepId: listModels
    description: List all models reachable through the gateway to confirm availability.
    operationId: listModels
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      models: $response.body#/data
    onSuccess:
    - name: modelAvailable
      type: goto
      stepId: complete
      criteria:
      - context: $response.body
        condition: $.data[?(@.id == '$inputs.model')]
        type: jsonpath
    - name: modelMissing
      type: end
      criteria:
      - context: $response.body
        condition: $.data[?(@.id == '$inputs.model')].length == 0
        type: jsonpath
  - stepId: complete
    description: Create a chat completion against the confirmed model.
    operationId: createChatCompletion
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    requestBody:
      contentType: application/json
      payload:
        model: $inputs.model
        messages:
        - role: user
          content: $inputs.prompt
        max_tokens: $inputs.maxTokens
        stream: false
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      completionId: $response.body#/id
      reply: $response.body#/choices/0/message/content
      finishReason: $response.body#/choices/0/finish_reason
      totalTokens: $response.body#/usage/total_tokens
  outputs:
    reply: $steps.complete.outputs.reply
    finishReason: $steps.complete.outputs.finishReason
    totalTokens: $steps.complete.outputs.totalTokens

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/vercel-discover-model-then-complete-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.