ChatGPT · Arazzo Workflow

ChatGPT Create and Poll a Response

Version 1.0.0

Create a stored response and poll it until generation completes.

1 workflow 1 source API 1 provider
View Spec View on GitHub AgentsArtificial IntelligenceChatGPTEmbeddingsFine-TuningGPT-4GPT-5Language ModelOpenAIReal-TimeArazzoWorkflows

Provider

chatgpt

Workflows

create-and-poll-response
Create a Responses API response and poll until it reaches a terminal status.
Creates a stored response from a text prompt, then retrieves it by id and loops while the status is in_progress. Once the response settles it routes to a completed, failed, or incomplete terminal step.
4 steps inputs: apiKey, input, instructions, model outputs: failureReason, failureStatus, outputText, responseId, totalTokens
1
createResponse
createResponse
Submit the prompt to the Responses API as a stored response so it can be retrieved by id while it generates.
2
pollResponse
getResponse
Retrieve the stored response by id. Repeats while the status is still in_progress and then branches on the terminal status.
3
returnCompleted
getResponse
Retrieve the settled response once more to capture the final generated text and token usage for a completed run.
4
returnIncomplete
getResponse
Retrieve the settled response to capture the failure error object or the reason the response is incomplete.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: ChatGPT Create and Poll a Response
  summary: Create a stored response and poll it until generation completes.
  description: >-
    Submits a prompt to the OpenAI Responses API and then polls the stored
    response by id until its status leaves the in_progress state. The flow
    branches on the terminal status so a completed response surfaces its
    generated text while a failed or incomplete response surfaces the error
    or the reason the model stopped early. 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
  x-realizes-capability-ids:
  - BC-610.60
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-610.60
      capability_name: Artificial Intelligence Management
      spec: chatgpt-responses-api-openapi.yml
      confidence: 0.7
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: responsesApi
  url: ../openapi/chatgpt-responses-api-openapi.yml
  type: openapi
workflows:
- workflowId: create-and-poll-response
  summary: Create a Responses API response and poll until it reaches a terminal status.
  description: >-
    Creates a stored response from a text prompt, then retrieves it by id and
    loops while the status is in_progress. Once the response settles it routes
    to a completed, failed, or incomplete terminal step.
  inputs:
    type: object
    required:
    - apiKey
    - model
    - input
    properties:
      apiKey:
        type: string
        description: OpenAI API key used as the Bearer credential.
      model:
        type: string
        description: Model ID used to generate the response (e.g. gpt-4o).
      input:
        type: string
        description: The text prompt to send to the model.
      instructions:
        type: string
        description: Optional system-level guidance for the model.
  steps:
  - stepId: createResponse
    description: >-
      Submit the prompt to the Responses API as a stored response so it can be
      retrieved by id while it generates.
    operationId: createResponse
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        model: $inputs.model
        input: $inputs.input
        instructions: $inputs.instructions
        store: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      responseId: $response.body#/id
      status: $response.body#/status
  - stepId: pollResponse
    description: >-
      Retrieve the stored response by id. Repeats while the status is still
      in_progress and then branches on the terminal status.
    operationId: getResponse
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: response_id
      in: path
      value: $steps.createResponse.outputs.responseId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
      outputText: $response.body#/output/0/content/0/text
      totalTokens: $response.body#/usage/total_tokens
    onSuccess:
    - name: stillRunning
      type: goto
      stepId: pollResponse
      criteria:
      - context: $response.body
        condition: $.status == "in_progress"
        type: jsonpath
    - name: succeeded
      type: goto
      stepId: returnCompleted
      criteria:
      - context: $response.body
        condition: $.status == "completed"
        type: jsonpath
    - name: didNotComplete
      type: goto
      stepId: returnIncomplete
      criteria:
      - context: $response.body
        condition: $.status != "completed" && $.status != "in_progress"
        type: jsonpath
  - stepId: returnCompleted
    description: >-
      Retrieve the settled response once more to capture the final generated
      text and token usage for a completed run.
    operationId: getResponse
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: response_id
      in: path
      value: $steps.createResponse.outputs.responseId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      outputText: $response.body#/output/0/content/0/text
      totalTokens: $response.body#/usage/total_tokens
    onSuccess:
    - name: done
      type: end
  - stepId: returnIncomplete
    description: >-
      Retrieve the settled response to capture the failure error object or the
      reason the response is incomplete.
    operationId: getResponse
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: response_id
      in: path
      value: $steps.createResponse.outputs.responseId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      finalStatus: $response.body#/status
      errorMessage: $response.body#/error/message
      incompleteReason: $response.body#/incomplete_details/reason
  outputs:
    responseId: $steps.createResponse.outputs.responseId
    outputText: $steps.returnCompleted.outputs.outputText
    totalTokens: $steps.returnCompleted.outputs.totalTokens
    failureStatus: $steps.returnIncomplete.outputs.finalStatus
    failureReason: $steps.returnIncomplete.outputs.incompleteReason

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/chatgpt-create-and-poll-response-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.