> ## Documentation Index
> Fetch the complete documentation index at: https://developers.gotolstoy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Uploads and workspace

> Tools that upload files to the media Library, read the workspace's credits and open the Tolstoy panel.

## start\_media\_upload

Starts an upload of a local image or video file to the workspace Library. It creates the Library item, whose id is assetId, and returns a signed transfer plan of shell commands that send the file's bytes straight to storage, so the file never passes through the model. \<PATH\_TO\_FILE> in a command stands for the local file path. A single plan is one curl command. A multipart plan has one command per part: part i sends partSize bytes of the file, from byte i × partSize, to partUrls\[i]. The transfer host can refuse a request. The item is unfinished until its upload is finished.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {
>     "fileName": {
>       "type": "string",
>       "minLength": 1,
>       "maxLength": 200,
>       "description": "The file name, with its extension."
>     },
>     "assetType": {
>       "type": "string",
>       "enum": [
>         "image",
>         "video"
>       ],
>       "description": "The real kind of the file."
>     },
>     "contentType": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The exact MIME type, such as image/png, image/jpeg, video/mp4 or video/quicktime."
>     },
>     "sizeBytes": {
>       "type": "integer",
>       "exclusiveMinimum": 0,
>       "description": "The exact file size in bytes."
>     }
>   },
>   "required": [
>     "fileName",
>     "assetType",
>     "contentType",
>     "sizeBytes"
>   ],
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```

## finish\_media\_upload

Finishes a Library upload after every request of its transfer plan succeeded. Returns the Library item id (assetId), its media id (mediaId) and its status; the item is done once its media is processed. Calling it again after a success returns the same item.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {
>     "assetId": {
>       "type": "string",
>       "format": "uuid",
>       "description": "The assetId of the upload plan."
>     },
>     "uploadId": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The uploadId of a multipart upload plan."
>     }
>   },
>   "required": [
>     "assetId"
>   ],
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```

## upload\_media\_from\_panel

Opens a file picker in the Tolstoy panel, where the user picks images or videos from their device. The panel uploads each file to the workspace Library, then posts a message with the Library id and the media id of every file that arrived.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {},
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```

## get\_usage

Reads the workspace's credit balances and usage for this billing period. studio (Tolstoy Agent and generations), shopper (AI Sales Agent) and widget-ai (Widget Builder) each give the credits available, the period allowance and the percentage left. player (Shoppable Videos) gives the storefront video views used and the period limit, null when unlimited.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {},
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```

## open\_tolstoy

Opens the Tolstoy panel in this chat, where the user browses the workspace's Library, saved models, templates and conversations, and uploads files by hand. Items the user selects in the panel reach this chat as context; selecting an item starts no work.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {},
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.