Upload a photo, video, PDF document or SRT captions file (the raw bytes as the body)
uploadMediaUpload a photo, video, PDF document or SRT captions file (the raw bytes as the body). HTTP 402 media_storage_full includes used_bytes, limit_bytes and next_step when card-free workspace storage is full; workspace_inactive indicates a lapsed plan.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "uploadMedia"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | ||
| width | No | The image's width in pixels, for the previews: digits only, without px, at least 1. Used only when the file's own width can't be read (an animated WebP, an unusual video); the file's own size always wins. Leave it out if you don't know it. | |
| height | No | The image's height in pixels, for the previews: digits only, without px, at least 1. Used only when the file's own height can't be read; the file's own size always wins. Leave it out if you don't know it. | |
| duration | No | A video's length in seconds, without a unit suffix, more than 0. Used only when the file's own duration can't be read. | |
| filename | No | ||
| workspace | No | Leave out for the token's workspace (ws_…). | |
| data_base64 | No | The file's bytes, base64-encoded. | |
| content_type | No | The file's type. | |
| idempotency_key | No | A new UUID per request; resending the same key and request is a safe retry. |