v3
latestSwagger 2.02026-07-1342207288.7 KBCreates a new run for an agent thread.
Path parameters
Identifier of the thread.
Query parameters
The API version to use for this operation.
A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.
Request body
The ID of the agent that should run the thread.
The overridden model name that the agent should use to run the thread.
The overridden system instructions that the agent should use to run the thread.
Additional instructions to append at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
If true, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status incomplete. See incomplete_details for more info.
The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status incomplete. See incomplete_details for more info.
If true functions will run in parallel during tool use.
A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
Response
Information about the new thread run.
The identifier, which can be referenced in API endpoints.
The object type, which is always 'thread.run'.
The ID of the thread associated with this run.
The ID of the agent associated with the thread this run was performed against.
Possible values for the status of an agent thread run.
The ID of the model to use.
The overridden system instructions used for this agent thread run.
The Unix timestamp, in seconds, representing when this object was created.
The Unix timestamp, in seconds, representing when this item expires.
The Unix timestamp, in seconds, representing when this item was started.
The Unix timestamp, in seconds, representing when this completed.
The Unix timestamp, in seconds, representing when this was cancelled.
The Unix timestamp, in seconds, representing when this failed.
The sampling temperature used for this run. If not set, defaults to 1.
The nucleus sampling value used for this run. If not set, defaults to 1.
The maximum number of prompt tokens specified to have been used over the course of the run.
The maximum number of completion tokens specified to have been used over the course of the run.
A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
Determines if tools can be executed in parallel within the run.