A run on a thread

Represents an execution run on a [thread](/docs/api-reference/threads).

Artificial IntelligenceEmbeddingsGPTGenerative AILLMOpenAI

Properties

Name Type Description
id string The identifier, which can be referenced in API endpoints.
object string The object type, which is always `thread.run`.
created_at integer The Unix timestamp (in seconds) for when the run was created.
thread_id string The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.
assistant_id string The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.
status object The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.
required_action object Details on the action required to continue the run. Will be `null` if no action is required.
last_error object The last error associated with this run. Will be `null` if there are no errors.
expires_at integer The Unix timestamp (in seconds) for when the run will expire.
started_at integer The Unix timestamp (in seconds) for when the run was started.
cancelled_at integer The Unix timestamp (in seconds) for when the run was cancelled.
failed_at integer The Unix timestamp (in seconds) for when the run failed.
completed_at integer The Unix timestamp (in seconds) for when the run was completed.
incomplete_details object Details on why the run is incomplete. Will be `null` if the run is not incomplete.
model string The model that the [assistant](/docs/api-reference/assistants) used for this run.
instructions string The instructions that the [assistant](/docs/api-reference/assistants) used for this run.
tools array The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.
metadata object
usage object
temperature object The sampling temperature used for this run. If not set, defaults to 1.
top_p object The nucleus sampling value used for this run. If not set, defaults to 1.
max_prompt_tokens object The maximum number of prompt tokens specified to have been used over the course of the run.
max_completion_tokens object The maximum number of completion tokens specified to have been used over the course of the run.
truncation_strategy object
tool_choice object
parallel_tool_calls boolean Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
response_format object
View JSON Schema on GitHub

JSON Schema

microsoft-azure-openai-open-ai-run-object-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-openai/json-schema/microsoft-azure-openai-open-ai-run-object-schema.json",
  "title": "A run on a thread",
  "description": "Represents an execution run on a [thread](/docs/api-reference/threads).",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-openai-v1-openapi.yml#/components/schemas/OpenAI.RunObject",
  "type": "object",
  "required": [
    "id",
    "object",
    "created_at",
    "thread_id",
    "assistant_id",
    "status",
    "required_action",
    "last_error",
    "expires_at",
    "started_at",
    "cancelled_at",
    "failed_at",
    "completed_at",
    "incomplete_details",
    "model",
    "instructions",
    "tools",
    "metadata",
    "usage",
    "max_prompt_tokens",
    "max_completion_tokens",
    "truncation_strategy",
    "tool_choice",
    "parallel_tool_calls",
    "response_format"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The identifier, which can be referenced in API endpoints."
    },
    "object": {
      "type": "string",
      "enum": [
        "thread.run"
      ],
      "description": "The object type, which is always `thread.run`.",
      "x-stainless-const": true
    },
    "created_at": {
      "type": "integer",
      "format": "unixtime",
      "description": "The Unix timestamp (in seconds) for when the run was created."
    },
    "thread_id": {
      "type": "string",
      "description": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run."
    },
    "assistant_id": {
      "type": "string",
      "description": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run."
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/OpenAI.RunStatus"
        }
      ],
      "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`."
    },
    "required_action": {
      "anyOf": [
        {
          "$ref": "#/$defs/OpenAI.RunObjectRequiredAction"
        },
        {
          "type": "null"
        }
      ],
      "description": "Details on the action required to continue the run. Will be `null` if no action is required."
    },
    "last_error": {
      "anyOf": [
        {
          "$ref": "#/$defs/OpenAI.RunObjectLastError"
        },
        {
          "type": "null"
        }
      ],
      "description": "The last error associated with this run. Will be `null` if there are no errors."
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "type": "integer",
      "format": "unixTimestamp",
      "description": "The Unix timestamp (in seconds) for when the run will expire."
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "type": "integer",
      "format": "unixTimestamp",
      "description": "The Unix timestamp (in seconds) for when the run was started."
    },
    "cancelled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "type": "integer",
      "format": "unixTimestamp",
      "description": "The Unix timestamp (in seconds) for when the run was cancelled."
    },
    "failed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "type": "integer",
      "format": "unixTimestamp",
      "description": "The Unix timestamp (in seconds) for when the run failed."
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "type": "integer",
      "format": "unixTimestamp",
      "description": "The Unix timestamp (in seconds) for when the run was completed."
    },
    "incomplete_details": {
      "anyOf": [
        {
          "$ref": "#/$defs/OpenAI.RunObjectIncompleteDetails"
        },
        {
          "type": "null"
        }
      ],
      "description": "Details on why the run is incomplete. Will be `null` if the run is not incomplete."
    },
    "model": {
      "type": "string",
      "description": "The model that the [assistant](/docs/api-reference/assistants) used for this run."
    },
    "instructions": {
      "type": "string",
      "description": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run."
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OpenAI.AssistantTool"
      },
      "maxItems": 20,
      "description": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.",
      "default": []
    },
    "metadata": {
      "anyOf": [
        {
          "$ref": "#/$defs/OpenAI.Metadata"
        },
        {
          "type": "null"
        }
      ]
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/OpenAI.RunCompletionUsage"
        },
        {
          "type": "null"
        }
      ]
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "description": "The sampling temperature used for this run. If not set, defaults to 1."
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "description": "The nucleus sampling value used for this run. If not set, defaults to 1."
    },
    "max_prompt_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "minimum": 256,
      "description": "The maximum number of prompt tokens specified to have been used over the course of the run."
    },
    "max_completion_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "minimum": 256,
      "description": "The maximum number of completion tokens specified to have been used over the course of the run."
    },
    "truncation_strategy": {
      "$ref": "#/$defs/OpenAI.TruncationObject"
    },
    "tool_choice": {
      "$ref": "#/$defs/OpenAI.AssistantsApiToolChoiceOption"
    },
    "parallel_tool_calls": {
      "type": "boolean",
      "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
      "default": true
    },
    "response_format": {
      "$ref": "#/$defs/OpenAI.AssistantsApiResponseFormatOption"
    }
  },
  "x-oaiMeta": {
    "name": "The run object",
    "beta": true
  },
  "$defs": {
    "OpenAI.AssistantTool": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/OpenAI.AssistantToolType"
        }
      }
    },
    "OpenAI.AssistantToolType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "code_interpreter",
            "file_search",
            "function"
          ]
        }
      ]
    },
    "OpenAI.AssistantsApiResponseFormatOption": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "auto"
          ]
        },
        {
          "$ref": "#/$defs/OpenAI.ResponseFormatText"
        },
        {
          "$ref": "#/$defs/OpenAI.ResponseFormatJsonObject"
        },
        {
          "$ref": "#/$defs/OpenAI.ResponseFormatJsonSchema"
        }
      ],
      "description": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n*Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length."
    },
    "OpenAI.AssistantsApiToolChoiceOption": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "required"
          ]
        },
        {
          "$ref": "#/$defs/OpenAI.AssistantsNamedToolChoice"
        }
      ],
      "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool."
    },
    "OpenAI.AssistantsNamedToolChoice": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "function",
            "code_interpreter",
            "file_search"
          ],
          "description": "The type of the tool. If type is `function`, the function name must be set"
        },
        "function": {
          "$ref": "#/$defs/OpenAI.AssistantsNamedToolChoiceFunction"
        }
      },
      "description": "Specifies a tool the model should use. Use to force the model to call a specific tool."
    },
    "OpenAI.AssistantsNamedToolChoiceFunction": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "OpenAI.CreateChatCompletionRequestResponseFormat": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/OpenAI.CreateChatCompletionRequestResponseFormatType"
        }
      },
      "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
    },
    "OpenAI.CreateChatCompletionRequestResponseFormatType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "text",
            "json_schema",
            "json_object"
          ]
        }
      ]
    },
    "OpenAI.Metadata": {
      "type": "object",
      "unevaluatedProperties": {
        "type": "string"
      },
      "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
      "x-oaiTypeLabel": "map"
    },
    "OpenAI.ResponseFormatJsonObject": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "json_object"
          ],
          "description": "The type of response format being defined. Always `json_object`.",
          "x-stainless-const": true
        }
      },
      "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
      "title": "JSON object"
    },
    "OpenAI.ResponseFormatJsonSchema": {
      "type": "object",
      "required": [
        "type",
        "json_schema"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "json_schema"
          ],
          "description": "The type of response format being defined. Always `json_schema`.",
          "x-stainless-const": true
        },
        "json_schema": {
          "allOf": [
            {
              "$ref": "#/$defs/OpenAI.ResponseFormatJsonSchemaJsonSchema"
            }
          ],
          "description": "Structured Outputs configuration options, including a JSON Schema.",
          "title": "JSON schema"
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/OpenAI.CreateChatCompletionRequestResponseFormat"
        }
      ],
      "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
      "title": "JSON schema"
    },
    "OpenAI.ResponseFormatJsonSchemaJsonSchema": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "schema": {
          "$ref": "#/$defs/OpenAI.ResponseFormatJsonSchemaSchema"
        },
        "strict": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "OpenAI.ResponseFormatJsonSchemaSchema": {
      "type": "object",
      "unevaluatedProperties": {},
      "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).",
      "title": "JSON schema"
    },
    "OpenAI.ResponseFormatText": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text"
          ],
          "description": "The type of response format being defined. Always `text`.",
          "x-stainless-const": true
        }
      },
      "description": "Default response format. Used to generate text responses.",
      "title": "Text"
    },
    "OpenAI.RunCompletionUsage": {
      "type": "object",
      "required": [
        "completion_tokens",
        "prompt_tokens",
        "total_tokens"
      ],
      "properties": {
        "completion_tokens": {
          "type": "integer",
          "description": "Number of completion tokens used over the course of the run."
        },
        "prompt_tokens": {
          "type": "integer",
          "description": "Number of prompt tokens used over the course of the run."
        },
        "total_tokens": {
          "type": "integer",
          "description": "Total number of tokens used (prompt + completion)."
        }
      },
      "description": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.)."
    },
    "OpenAI.RunObjectIncompleteDetails": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "max_completion_tokens",
            "max_prompt_tokens"
          ]
        }
      }
    },
    "OpenAI.RunObjectLastError": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "server_error",
            "rate_limit_exceeded",
            "invalid_prompt"
          ]
        },
        "message": {
          "type": "string"
        }
      }
    },
    "OpenAI.RunObjectRequiredAction": {
      "type": "object",
      "required": [
        "type",
        "submit_tool_outputs"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "submit_tool_outputs"
          ],
          "x-stainless-const": true
        },
        "submit_tool_outputs": {
          "$ref": "#/$defs/OpenAI.RunObjectRequiredActionSubmitToolOutputs"
        }
      }
    },
    "OpenAI.RunObjectRequiredActionSubmitToolOutputs": {
      "type": "object",
      "required": [
        "tool_calls"
      ],
      "properties": {
        "tool_calls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OpenAI.RunToolCallObject"
          }
        }
      }
    },
    "OpenAI.RunStatus": {
      "type": "string",
      "enum": [
        "queued",
        "in_progress",
        "requires_action",
        "cancelling",
        "cancelled",
        "failed",
        "completed",
        "incomplete",
        "expired"
      ],
      "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`."
    },
    "OpenAI.RunToolCallObject": {
      "type": "object",
      "required": [
        "id",
        "type",
        "function"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint."
        },
        "type": {
          "type": "string",
          "enum": [
            "function"
          ],
          "description": "The type of tool call the output is required for. For now, this is always `function`.",
          "x-stainless-const": true
        },
        "function": {
          "allOf": [
            {
              "$ref": "#/$defs/OpenAI.RunToolCallObjectFunction"
            }
          ],
          "description": "The function definition."
        }
      },
      "description": "Tool call objects"
    },
    "OpenAI.RunToolCallObjectFunction": {
      "type": "object",
      "required": [
        "name",
        "arguments"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "arguments": {
          "type": "string"
        }
      }
    },
    "OpenAI.TruncationObject": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "auto",
            "last_messages"
          ],
          "description": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`."
        },
        "last_messages": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.",
      "title": "Thread Truncation Controls"
    }
  }
}

Work with this as data

Every JSON Schema 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 schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema 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 JSON Schema
curl "https://apis.io/api/v1/json-schemas/microsoft-azure-openai-open-ai-run-object"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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