Submit Task
submit_taskSubmit a one-off Python script to run to completion on a GPU or CPU, preview cost before confirming, then poll status and read logs.
Instructions
Submit a one-off task (a script that runs to completion on a GPU or CPU). It is billed while it runs, up to
max_duration. With confirm=false (default) it only returns the estimate; call again with confirm=true after the
user agreed. Then poll the tasks tool for status and read output with logs.
script is Python source (max 256 KiB) run inside image (or a template_id); use print(..., flush=True) so output
reaches the logs. Pass exactly one of gpu_model (GPU task, optional gpu_count/gpu_vram_gb) or cpu_preset
(e.g. "micro-2c8g", "small-4c16g", "standard-8c32g"). max_duration seconds (3600..86400) is a hard stop.
max_price_per_hour caps the final compute rate only; storage, Asset Hub retention and fetch-time charges are separate.
The estimate is not a total-bill ceiling. input_assets attaches Asset Hub assets as ["asset_id" or {"asset": id, "target_dir": dir}] under /inputs.
output_include uploads only the /outputs files matching these globs, relative to /outputs and case-sensitive:
[".safetensors"] matches at any depth, ["samples/.png"] only in that folder, ["checkpoints/"] every folder of that name
with its contents; omitted = every file. Files left out still use /outputs disk while the task runs.
A task's output_include is null when no filter was given; if you passed output_include and the submitted task's is
null, the server ignores the filter and uploads every file.
Every write requires operation_id. Reuse the ID returned by the preview, or generate a UUID before the first call. Keep it for confirmation and all retries; a new ID means a new operation. After a timeout, check operation_status and resource state before retrying.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| args | No | ||
| name | Yes | ||
| image | No | ||
| script | Yes | ||
| confirm | No | ||
| gpu_count | No | ||
| gpu_model | No | ||
| workspace | No | ||
| cpu_preset | No | ||
| gpu_vram_gb | No | ||
| secret_keys | No | ||
| template_id | No | ||
| webhook_url | No | ||
| input_assets | No | ||
| max_duration | No | ||
| operation_id | No | ||
| requirements | No | ||
| output_include | No | ||
| max_price_per_hour | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||