Modify thread
POSThttps:/api.openai.com/v1/threads/{thread_id}
Modifies a thread.
Path parameters
thread_idstringRequired
The ID of the thread to modify. Only the
metadatacan be modified.
Request body
tool_resourcesobject or null
A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the
code_interpretertool requires a list of file IDs, while thefile_searchtool requires a list of vector store IDs.code_interpreterobject
file_idsarrayDefaults:
A list of file IDs made available to the
code_interpretertool. There can be a maximum of 20 files associated with the tool.itemsstring
file_searchobject
vector_store_idsarray
The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
itemsstring
metadataobject or null
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.
Response
The modified thread object matching the specified ID.
Example request
1 curl https://api.openai.com/v1/threads/thread_abc123 \2 -H "Content-Type: application/json" \3 -H "Authorization: Bearer $OPENAI_API_KEY" \4 -H "OpenAI-Beta: assistants=v2" \5 -d '{6 "metadata": {7 "modified": "true",8 "user": "abc123"9 }10 }'
Example response
1 {2 "id": "thread_abc123",3 "object": "thread",4 "created_at": 1699014083,5 "metadata": {6 "modified": "true",7 "user": "abc123"8 },9 "tool_resources": {}10 }
Built with