Path parameters
-
The ID of the thread that was run.
-
The ID of the run to modify.
Body
Required
-
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
POST
/threads/{thread_id}/runs/{run_id}
curl \
--request POST 'https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"metadata":{"additionalProperty1":"string","additionalProperty2":"string"}}'
Request examples
{
"metadata": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
Response examples (200)
{
"id": "string",
"object": "thread.run",
"created_at": 42,
"thread_id": "string",
"assistant_id": "string",
"status": "queued",
"required_action": {
"type": "submit_tool_outputs",
"submit_tool_outputs": {
"tool_calls": [
{
"id": "string",
"type": "function",
"function": {
"name": "string",
"arguments": "string"
}
}
]
}
},
"last_error": {
"code": "server_error",
"message": "string"
},
"expires_at": 42,
"started_at": 42,
"cancelled_at": 42,
"failed_at": 42,
"completed_at": 42,
"incomplete_details": {
"reason": "max_completion_tokens"
},
"model": "string",
"instructions": "string",
"tools": [
{
"type": "code_interpreter"
}
],
"metadata": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"usage": {
"completion_tokens": 42,
"prompt_tokens": 42,
"total_tokens": 42
},
"temperature": 42.0,
"top_p": 42.0,
"max_prompt_tokens": 42,
"max_completion_tokens": 42,
"truncation_strategy": {
"type": "auto",
"last_messages": 42
},
"tool_choice": "none",
"parallel_tool_calls": true,
"response_format": "auto"
}