OpenAI · Arazzo Workflow

OpenAI List Models then Create Chat Completion

Version 1.0.0

Discover an available model, then generate a chat completion with it.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub Artificial IntelligenceLarge Language ModelsT1ArazzoWorkflows

Provider

openai

Workflows

list-models-then-chat
List models and create a chat completion with a selected model.
Retrieves the catalog of available models so a caller can confirm the target model exists, then sends a single user message to the chat completions endpoint and returns the assistant reply.
2 steps inputs: apiKey, model, userMessage outputs: completionId, models, reply
1
listModels
List the models available to the authenticated account.
2
createChat
Create a chat completion using the selected model and the supplied user message.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: OpenAI List Models then Create Chat Completion
  summary: Discover an available model, then generate a chat completion with it.
  description: >-
    Lists the models available to the authenticated account, confirms the
    requested model id is present, and then creates a chat completion using
    that model. Every step spells out its request inline so the flow can be
    read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: chatApi
  url: ../openapi/openai-chat-api-openapi.yml
  type: openapi
- name: modelsApi
  url: ../openapi/openai-models-api-openapi.yml
  type: openapi
workflows:
- workflowId: list-models-then-chat
  summary: List models and create a chat completion with a selected model.
  description: >-
    Retrieves the catalog of available models so a caller can confirm the
    target model exists, then sends a single user message to the chat
    completions endpoint and returns the assistant reply.
  inputs:
    type: object
    required:
    - apiKey
    - model
    - userMessage
    properties:
      apiKey:
        type: string
        description: OpenAI API key used as a Bearer token.
      model:
        type: string
        description: The model id to use for the chat completion (e.g. gpt-4o-mini).
      userMessage:
        type: string
        description: The user message content to send to the model.
  steps:
  - stepId: listModels
    description: List the models available to the authenticated account.
    operationId: listModels
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      models: $response.body#/data
  - stepId: createChat
    description: >-
      Create a chat completion using the selected model and the supplied user
      message.
    operationId: createChatCompletion
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        model: $inputs.model
        messages:
        - role: user
          content: $inputs.userMessage
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      completionId: $response.body#/id
      reply: $response.body#/choices/0/message/content
      finishReason: $response.body#/choices/0/finish_reason
  outputs:
    models: $steps.listModels.outputs.models
    completionId: $steps.createChat.outputs.completionId
    reply: $steps.createChat.outputs.reply

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/openai-list-models-then-chat-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.