Skip to main content
POST
Run a job

Authorizations

Authorization
string
header
required

Use a Runcrate API key with the rc_live_* prefix as the bearer token. Create one at https://www.runcrate.ai/dashboard/api-keys.

Headers

Idempotency-Key
string

Unique per environment for 24 hours. Sending the same request again answers the original job (or group) with 200 and Idempotent-Replayed: true instead of starting another; the same key with a different request is a 409 with details.reason: idempotency_conflict.

Maximum string length: 255

Body

application/json
command
string
required

Shell command, run with bash in /workspace. At most 65536 bytes. It must also fit in the machine's launch script: about 5 KB of ordinary shell. Put a longer script in a file on a volume or in the image and run that.

Minimum string length: 1
gpu_type
required

GPU model (e.g. A4000, H100), as listed by GET /instances/types, or a list to try in order, e.g. ["H100", "A100-80GB:2"]. :N sets that entry's GPU count; entries without one use gpu_count.

max_runtime_minutes
integer
required

Longest each attempt's command may run, counted from when it starts, up to 7 days. Required: a job never runs unbounded.

Required range: 1 <= x <= 10080
gpu_count
integer
default:1
Required range: 1 <= x <= 8
template
string
default:ubuntu-devbox

OS template id from GET /templates.

image
string

Container image to run the command in. /workspace is mounted and the image is pulled before the max runtime starts. The GPUs are passed into the container only on machines with the NVIDIA container runtime; otherwise the job log says so and the command runs without GPUs. The image needs bash or sh.

env
object

Environment variables for the command, as { "KEY": "value" }, added to the environment's secrets (a name set in both takes this value). Keys match ^[A-Za-z_][A-Za-z0-9_]*$ and don't start with RUNCRATE_; at most 200 keys, values up to 32 KB, 64 KB in total with the secrets. Values are stored only encrypted and never returned.

storage_id
string

Volume to mount at /workspace. Must be in the same workspace and environment and not attached to another machine.

name
string

Defaults to job-<first 8 chars of id>.

Maximum string length: 63
region
string

Only run in this region, matched as for instances. Defaults to any region.

capacity_wait_minutes
integer
default:30

How long to wait for capacity on any of the GPUs before the job fails. The job stays queued with queue_reason: no_capacity meanwhile. 0 fails at once.

Required range: 0 <= x <= 1440
max_retries
integer
default:0

Run the command again on a new machine at most this many times when an attempt fails. A machine failure is always retried; a failing command only under retry_on or retry_exit_codes.

Required range: 0 <= x <= 10
retry_on
enum<string>[]

What is retried. machine_failure is on whenever max_retries is above 0.

Available options:
machine_failure,
nonzero_exit
retry_exit_codes
integer[]

Retry only these exit codes. Takes precedence over nonzero_exit.

Maximum array length: 32
Required range: 1 <= x <= 255
count
integer

Run this many copies as a group. Each sees RUNCRATE_JOB_INDEX and RUNCRATE_JOB_COUNT.

Required range: 1 <= x <= 100
params
object[]

One env object per job of a group, merged over env. Instead of count.

Required array length: 1 - 100 elements
max_parallel
integer

With count or params: how many of the group run at once. Defaults to all.

Required range: 1 <= x <= 100
tags
object

At most 20. Keys match ^[a-z0-9_.:-]{1,40}$.

webhook_url
string

https URL that gets the job's events, signed like the workspace's webhooks (or with a webhook_secret returned once when the workspace has no webhook endpoint), delivered and retried the same way.

webhook_events
enum<string>[]
Available options:
started,
finished
idempotency_key
string

Same as the Idempotency-Key header, for clients that cannot set headers.

Maximum string length: 255
code
object

Code put in /workspace/code before the command starts; the command runs there.

image_registry_auth
object

Sign in to the image's registry before the pull, with the values of these two env variables or secrets.

allow_cpu_container
boolean
default:false

Run the image without GPUs when the machine cannot pass them into a container, instead of failing.

Response

A replay of an earlier request with the same Idempotency-Key: the job (or group) it created, as it is now. The Idempotent-Replayed: true header is set.

data
object
required

One command run on its own fresh GPU machine. The machine stops, and billing ends, as soon as the command exits, hits max_runtime_minutes or is cancelled.