- Get started
- Introduction
- Authentication
- Making requests
- Streaming
- Audio
- Batch
- Models
- Invites
- Chat
- Users
- Projects
- Project users
- Project service accounts
- Project API keys
- Audit logs
- Usage
- Project rate limits
- Completions
- Uploads
- Embeddings
- Files
- Moderations
- Assistants (v1)
- Threads (v1)
- Messages (v1)
- Runs (v1)
- Images
- Fine-tuning
Submit tool outputs to run (v1)
POST
https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs
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
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
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
tool_call_id
stringÂ
optional
output
stringÂ
optional
Example
{
"tool_outputs": [
{
"tool_call_id": "call_001",
"output": "70 degrees and sunny."
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs' \
--header 'Authorization: Bearer $OPENAI_API_KEY' \
--header 'OpenAI-Beta: assistants=v1' \
--header 'Content-Type: application/json' \
--data-raw '{
"tool_outputs": [
{
"tool_call_id": "call_001",
"output": "70 degrees and sunny."
}
]
}'
Responses
🟢200Success
application/json
Body
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"
}
Modified at 2024-12-13 10:20:37