Update tool

Update the settings of an existing tool. You cannot change the tool type — only the type-specific settings can be updated.
WEB_SEARCH and CODE_INTERPRETER tools have no configurable settings and cannot be updated.

Request

PATCH https://superinterface.ai/api/cloud/assistants/{assistantId}/tools/{toolId}

Authentication

Include your private API key in the request headers:
Authorization: Bearer YOUR_PRIVATE_API_KEY

Path Parameters

ParameterTypeDescription
assistantIdstringThe ID of the assistant
toolIdstringThe ID of the tool

Request Body

Include the type-specific settings object for the tool you are updating. All fields within the object are optional — only provided fields are changed.
ParameterTypeDescription
fileSearchToolobjectUpdated settings for file search
imageGenerationToolobjectUpdated settings for image generation
computerUseToolobjectUpdated settings for computer use

fileSearchTool fields

FieldTypeDescription
vectorStoreIdsstring[]IDs of vector stores to search
maxNumResultsnumberMaximum number of results to return

imageGenerationTool fields

FieldTypeDescription
modelstringModel to use (gpt-image-1)
qualitystringAUTO, LOW, MEDIUM, or HIGH
sizestringAUTO, SIZE_1024_1024, SIZE_1024_1536, or SIZE_1536_1024
outputFormatstringPNG, WEBP, or JPEG
backgroundstringAUTO, TRANSPARENT, or OPAQUE
partialImagesnumberNumber of partial images to stream

computerUseTool fields

FieldTypeDescription
displayWidthnumberDisplay width in pixels (640–4096)
displayHeightnumberDisplay height in pixels (480–4096)
environmentstringLINUX, WINDOWS, MACOS, or BROWSER
mcpServerIdstring?ID of an MCP server linked to this assistant

Example request — update file search

curl -X PATCH "https://superinterface.ai/api/cloud/assistants/{assistantId}/tools/{toolId}" \ -H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "fileSearchTool": { "vectorStoreIds": ["vs_abc123", "vs_def456"], "maxNumResults": 30 } }'

Example request — update image generation

curl -X PATCH "https://superinterface.ai/api/cloud/assistants/{assistantId}/tools/{toolId}" \ -H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "imageGenerationTool": { "quality": "HIGH", "size": "SIZE_1024_1536", "outputFormat": "WEBP" } }'

Example request — update computer use

curl -X PATCH "https://superinterface.ai/api/cloud/assistants/{assistantId}/tools/{toolId}" \ -H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "computerUseTool": { "displayWidth": 1920, "displayHeight": 1080, "environment": "BROWSER" } }'

Response

ParameterTypeDescription
toolToolUpdated tool

Example response

{ "tool": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "type": "IMAGE_GENERATION", "imageGenerationTool": { "model": "gpt-image-1", "quality": "HIGH", "size": "SIZE_1024_1536", "outputFormat": "WEBP", "background": "AUTO", "partialImages": 0 }, "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T11:00:00Z" } }

Errors

The endpoint may return the following errors:

401 Unauthorized

This error occurs if the API key is invalid or missing.
{ "error": "Unauthorized", "message": "Invalid or missing API key" }