Create upload

Takes a multipart upload and writes the file into the session's sandbox, so a later run can read it.

POST /v1/exec/upload

Addresshttps://api.hanzo.ai/v1/exec/upload
MethodPOST
Operationpost_exec_upload
AuthAuthorization: Bearer $HANZO_API_KEY

Takes a multipart upload and writes the file into the session's sandbox, so a later run can read it. Answers the session id and the identifier the file is addressed by; session_id in the form joins an existing session instead of opening one.

The body is multipart/form-data, which is why this is not a typed operation: every non-empty typed body is decoded as JSON.

Request

The document declares no body for POST /v1/exec/upload. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask MCP's describe for post_exec_upload, which answers from the running route.

Response

The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.

Examples

hanzo exec upload
import { Configuration, ExecApi } from 'hanzoai';

const api = new ExecApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postExecUpload();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ExecApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ExecApi(client).post_exec_upload()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ExecAPI.PostExecUpload(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, exec_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = exec_api::post_exec_upload(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ExecApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ExecApi(client).postExecUpload();
curl -X POST https://api.hanzo.ai/v1/exec/upload \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches exec through the exec tool, which names its 2 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_exec_file"
         }
       }
     }'

Exec API · All Hanzo APIs · Interactive reference

Was this page useful?