Submit tool outputs to run (v1)
POST
https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputsWhen a run has the status: "requires_action"
and required_action.type
is submit_tool_outputs
, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
Request
Header Params
Authorization
string
required
Example:
Bearer $OPENAI_API_KEY
Content-Type
string
required
Example:
application/json
OpenAI-Beta
string
required
Example:
assistants=v1
Body Params application/json
tool_outputs
array [object {2}]
required
A list of tools for which the outputs are being submitted.
tool_call_id
string
optional
output
string
optional
Example
{
"tool_outputs": [
{
"tool_call_id": "call_001",
"output": "70 degrees and sunny."
}
]
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
id
string
required
object
string
required
created_at
integer
required
assistant_id
string
required
thread_id
string
required
status
string
required
started_at
integer
required
expires_at
integer
required
cancelled_at
null
required
failed_at
null
required
completed_at
null
required
last_error
null
required
model
string
required
instructions
null
required
incomplete_details
null
required
tools
array [object {2}]
required
type
string
optional
function
object
optional
file_ids
array[string]
required
metadata
object
required
usage
null
required
temperature
integer
required
top_p
integer
required
max_prompt_tokens
integer
required
max_completion_tokens
integer
required
truncation_strategy
object
required
type
string
required
last_messages
null
required
response_format
string
required
tool_choice
string
required
Example
{
"id": "run_123",
"object": "thread.run",
"created_at": 1699075592,
"assistant_id": "asst_123",
"thread_id": "thread_123",
"status": "queued",
"started_at": 1699075592,
"expires_at": 1699076192,
"cancelled_at": null,
"failed_at": null,
"completed_at": null,
"last_error": null,
"model": "gpt-4-turbo",
"instructions": null,
"incomplete_details": null,
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}
],
"file_ids": [],
"metadata": {},
"usage": null,
"temperature": 1,
"top_p": 1,
"max_prompt_tokens": 1000,
"max_completion_tokens": 1000,
"truncation_strategy": {
"type": "auto",
"last_messages": null
},
"response_format": "auto",
"tool_choice": "auto"
}
Last modified: a month ago