Jobs

Create job

Run a job in one call: route it, benchmark 2 to 3 GPUs when needed, pick the cheapest verified cost per unit, and run it there, keeping GPU spend under budget_usd. GET /v1/jobs/{id} follows it.

POST/v1/jobsAPI key

Authorization

Send Authorization: Bearer gr_... with a key from the Developer access page. The browser session cookie gpu_router_session also works.

Headers

Idempotency-Keystring | null

Required and non-empty; missing or empty answers 400 IDEMPOTENCY_KEY_REQUIRED

Body

job_specobjectrequired
Show child attributes
task_typeenum<string> | null

Needed for runtime matching; unset never matches.

Available options: training inference

model_idstring | null

Model the job trains or serves, such as Qwen/Qwen3-0.6B.

minLength: 1

precisionenum<string> | null

Numerical precision of the compute.

Available options: fp32 bf16 fp16 fp8 fp4 int8 int4

framework_versionstring | null

Framework and version string, matched exactly.

minLength: 1

islinteger | null

Inference input tokens per request.

minimum: 1

oslinteger | null

Inference output tokens per request.

minimum: 1

seq_leninteger | null

Training sequence length in tokens.

minimum: 1

concurrencyinteger | null

Inference requests in flight.

minimum: 1

global_batchinteger | null

Training examples per optimizer step across all GPUs.

minimum: 1

lora_rankinteger | null

LoRA rank when the job fine-tunes an adapter.

minimum: 1

work_unitsinteger | null

Units of work the job processes, such as requests or examples.

minimum: 1

maximum: 1000000000000

imagestringrequired

Immutable container image reference.

minLength: 1

pattern: ^(?:[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*(?::[0-9]{1,5})?/)?[a-z0-9]+(?:[._-]+[a-z0-9]+)*(?:/[a-z0-9]+(?:[._-]+[a-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9._-]{0,127})?(?:@sha256:[a-f0-9]{64})?$

commandstring[]required

minItems: 1

envobjectdefault: {}

Keys match ^[A-Za-z_][A-Za-z0-9_]*$; values are masked in every response and never logged.

inputsobject[]default: []
Show child attributes
urlstring<uri>required

minLength: 1

maxLength: 2083

mount_pathstringrequired
output_dirstringrequired
min_vram_gbintegerrequired

minimum: 1

gpu_countintegerdefault: 1
cpu_coresnumberrequired

maximum: 32

exclusiveMinimum: 0

memory_gbnumberrequired

maximum: 256

exclusiveMinimum: 0

timeout_secondsintegerrequired

At most 21600 (6 hours).

minimum: 1

maximum: 21600

workload_classstringrequired

minLength: 1

verifierobject | null
Show child attributes
expected_output_filesstring[]required

minItems: 1

metrics_filestringrequired
metric_must_decreasestringrequired

minLength: 1

allow_interruptiblebooleandefault: false

Lets an inference job use spot and preemptible capacity; training jobs always may.

budget_usdnumber | stringrequired

Hard cap on GPU spend for the whole job: benchmark runs plus the full run, in USD.

exclusiveMinimum: 0

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

gpusenum<string>[] | null

Optional shortlist: only these GPUs are benchmarked or run.

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

minItems: 1

max_benchmark_gpusintegerdefault: 3

minimum: 2

maximum: 3

Responses

202application/json

The job, already benchmarking or running: routed, then 2 to 3 GPUs benchmarked unless this job's fingerprint has recent verified measurements, then the cheapest verified cost per unit runs. If that launch fails to start, the job falls back to the next cheapest verified GPU that fits the budget left, up to 2 times. A repeated Idempotency-Key returns the first job without launching again.

Show response attributes
idstringrequired
user_idstringrequired
idempotency_keystringrequired
stateenum<string>required

Available options: routing benchmarking choosing running done failed

job_specobjectrequired

The submitted job; env values are masked.

Show child attributes
task_typeenum<string> | null

Needed for runtime matching; unset never matches.

Available options: training inference

model_idstring | null

Model the job trains or serves, such as Qwen/Qwen3-0.6B.

minLength: 1

precisionenum<string> | null

Numerical precision of the compute.

Available options: fp32 bf16 fp16 fp8 fp4 int8 int4

framework_versionstring | null

Framework and version string, matched exactly.

minLength: 1

islinteger | null

Inference input tokens per request.

minimum: 1

oslinteger | null

Inference output tokens per request.

minimum: 1

seq_leninteger | null

Training sequence length in tokens.

minimum: 1

concurrencyinteger | null

Inference requests in flight.

minimum: 1

global_batchinteger | null

Training examples per optimizer step across all GPUs.

minimum: 1

lora_rankinteger | null

LoRA rank when the job fine-tunes an adapter.

minimum: 1

work_unitsinteger | null

Units of work the job processes, such as requests or examples.

minimum: 1

maximum: 1000000000000

imagestringrequired

Immutable container image reference.

minLength: 1

pattern: ^(?:[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*(?::[0-9]{1,5})?/)?[a-z0-9]+(?:[._-]+[a-z0-9]+)*(?:/[a-z0-9]+(?:[._-]+[a-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9._-]{0,127})?(?:@sha256:[a-f0-9]{64})?$

commandstring[]required

minItems: 1

envobjectdefault: {}

Keys match ^[A-Za-z_][A-Za-z0-9_]*$; values are masked in every response and never logged.

inputsobject[]default: []
Show child attributes
urlstring<uri>required

minLength: 1

maxLength: 2083

mount_pathstringrequired
output_dirstringrequired
min_vram_gbintegerrequired

minimum: 1

gpu_countintegerdefault: 1
cpu_coresnumberrequired

maximum: 32

exclusiveMinimum: 0

memory_gbnumberrequired

maximum: 256

exclusiveMinimum: 0

timeout_secondsintegerrequired

At most 21600 (6 hours).

minimum: 1

maximum: 21600

workload_classstringrequired

minLength: 1

verifierobject | null
Show child attributes
expected_output_filesstring[]required

minItems: 1

metrics_filestringrequired
metric_must_decreasestringrequired

minLength: 1

allow_interruptiblebooleandefault: false

Lets an inference job use spot and preemptible capacity; training jobs always may.

budget_usdstringrequired

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

gpusenum<string>[] | nullrequired

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

max_benchmark_gpusintegerrequired
route_idstringrequired
benchmarkedenum<string>[]default: []

GPUs this job benchmarked; empty when it reused measurements.

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

resultsobject[]default: []

Verified cost per unit by GPU, cheapest first.

Show child attributes
gpuenum<string>required

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

usd_per_gpu_hourstring | nullrequired

The current rate the figures are priced at, not the rate when the runs were measured.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

runsintegerrequired

Qualified runs behind the figures.

unitstringrequired

1k steps for training, 1M tokens for inference.

usd_per_unitstringrequired

Median cost per unit of work: current hourly rate x GPUs / measured throughput.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

usd_per_unit_minstringrequired

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

usd_per_unit_maxstringrequired

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

throughputstringrequired

Median steady-state steps/s or tokens/s, or wall-clock work/duration without metric lines.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

startup_secondsstring | nullrequired

Median process start to first metric line; null without metric lines.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

projected_cost_usdstring | nullrequired

Full job at the current rate: usd_per_unit x the work from work_units, plus startup_seconds x the rate; null without work_units.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

wall_clock_onlybooleanrequired

True when a run printed no usable metric lines: lower confidence.

tied_withenum<string>[]required

GPUs whose min to max cost per unit overlaps this one's.

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

choiceobject | null
Show child attributes
gpuenum<string>required

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

usd_per_gpu_hourstringrequired

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

usd_per_unitstring | nullrequired

Median verified USD per unit of work; null when the only fitting GPU was not measured.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

reasonstringrequired

Why this GPU, in one sentence.

run_idstring | null
fallbacksobject[]default: []

Full-run launches that failed to start (launch error, or lost before it ever ran), in order; after each the job moved to the next cheapest verified GPU that fits the budget left, up to 2 times. run_id is then the GPU that actually ran.

Show child attributes
gpuenum<string>required

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

run_idstringrequired
reasonstringrequired

Why the launch on this GPU failed to start.

stepsobject[]required
Show child attributes
stateenum<string>required

Available options: routing benchmarking choosing running done failed

atstring<date-time>required
detailstringrequired
errorstring | null
budget_reachedbooleandefault: false

True when the job stopped because its budget could not cover the next step.

created_atstring<date-time>required
probesobject[]required

The job's benchmark runs, in launch order.

Show child attributes
idstringrequired
route_idstringrequired
user_idstringrequired
idempotency_keystringrequired
providerenum<string>required

Available options: modal lambda

gpuenum<string>required

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

provider_run_refstring | nullrequired
statusenum<string>required

Available options: accepted launching running succeeded failed cancel_requested cancelled lost

provider_confirmedbooleanrequired

Whether the provider observed the current status.

verification_statusenum<string>required

Available options: not_requested pending passed failed

exit_codeinteger | nullrequired
log_tailstring | nullrequired
created_atstring<date-time>required
launched_atstring<date-time> | nullrequired
started_atstring<date-time> | null

When the provider first reported the run running or finished; null if it never started.

finished_atstring<date-time> | nullrequired
status_checked_atstring<date-time> | nullrequired
last_errorstring | nullrequired
poll_failuresintegerdefault: 0

Consecutive failed status polls; reset by a successful poll.

kindenum<string>default: "job"

job for a run of the route's job, probe for a capped benchmark run on one candidate GPU.

Available options: job probe

benchmarkobject | null

The benchmark protocol settings of a probe run; null for a job run.

Show child attributes
benchmark_idstringrequired

Groups the runs of one Benchmark my job request.

repeatintegerrequired

1-based repeat of this run on its GPU.

runs_per_gpuintegerrequired
work_stepsintegerrequired

Steps (training) or requests (inference) every run performs, sent as GPU_ROUTER_MAX_STEPS or GPU_ROUTER_MAX_REQUESTS.

seedintegerrequired

Sent to every run as GPU_ROUTER_SEED.

max_secondsintegerrequired

Sandbox timeout of every run.

loss_tolerance_pctstring | nullrequired

Allowed final-loss distance from the median across GPUs, in percent; null disables the check.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

cap_usdstringrequired

Hard cap of the whole benchmark: rate x GPUs x max_seconds x runs_per_gpu, summed over GPUs.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

simulationobject | null

Set only on a simulated run of a sample job or a demo account's job: nothing was launched or billed, and it never counts as a measurement.

Show child attributes
duration_secondsstringrequired

Measured duration shown for the run, not its wall time.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

cost_usdstring | nullrequired

Simulated cost: duration_seconds at usd_per_gpu_hour of provider_name; nothing is billed.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

basisstringrequired

Where the duration comes from: the one verified sample run on this GPU the run replays, named by run id.

provider_namestringdefault: "Modal"

Provider whose listed rate prices the simulated cost.

usd_per_gpu_hourstring | null

That provider's listed rate per GPU-hour; null without one.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

served_runstring | null

Id of the verified sample run whose duration, metrics, outputs and log the run replays.

samplestringdefault: "lora"

Id of the gpu-router sample whose outputs the run serves.

stalebooleanrequired

True when the run is not terminal and its status was last checked (or, before any check, it launched or was accepted) more than 5 poll intervals ago.

provider_referenceobject | nullrequired

The Modal sandbox and app behind the run and its dashboard link; null when the run never launched.

Show child attributes
sandbox_idstringrequired
app_namestringrequired
dashboard_urlstringrequired
volume_namestringrequired
storage_urlstringrequired
runobject | nullrequired

The full run on the chosen GPU.

Show child attributes
idstringrequired
route_idstringrequired
user_idstringrequired
idempotency_keystringrequired
providerenum<string>required

Available options: modal lambda

gpuenum<string>required

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

provider_run_refstring | nullrequired
statusenum<string>required

Available options: accepted launching running succeeded failed cancel_requested cancelled lost

provider_confirmedbooleanrequired

Whether the provider observed the current status.

verification_statusenum<string>required

Available options: not_requested pending passed failed

exit_codeinteger | nullrequired
log_tailstring | nullrequired
created_atstring<date-time>required
launched_atstring<date-time> | nullrequired
started_atstring<date-time> | null

When the provider first reported the run running or finished; null if it never started.

finished_atstring<date-time> | nullrequired
status_checked_atstring<date-time> | nullrequired
last_errorstring | nullrequired
poll_failuresintegerdefault: 0

Consecutive failed status polls; reset by a successful poll.

kindenum<string>default: "job"

job for a run of the route's job, probe for a capped benchmark run on one candidate GPU.

Available options: job probe

benchmarkobject | null

The benchmark protocol settings of a probe run; null for a job run.

Show child attributes
benchmark_idstringrequired

Groups the runs of one Benchmark my job request.

repeatintegerrequired

1-based repeat of this run on its GPU.

runs_per_gpuintegerrequired
work_stepsintegerrequired

Steps (training) or requests (inference) every run performs, sent as GPU_ROUTER_MAX_STEPS or GPU_ROUTER_MAX_REQUESTS.

seedintegerrequired

Sent to every run as GPU_ROUTER_SEED.

max_secondsintegerrequired

Sandbox timeout of every run.

loss_tolerance_pctstring | nullrequired

Allowed final-loss distance from the median across GPUs, in percent; null disables the check.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

cap_usdstringrequired

Hard cap of the whole benchmark: rate x GPUs x max_seconds x runs_per_gpu, summed over GPUs.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

simulationobject | null

Set only on a simulated run of a sample job or a demo account's job: nothing was launched or billed, and it never counts as a measurement.

Show child attributes
duration_secondsstringrequired

Measured duration shown for the run, not its wall time.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

cost_usdstring | nullrequired

Simulated cost: duration_seconds at usd_per_gpu_hour of provider_name; nothing is billed.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

basisstringrequired

Where the duration comes from: the one verified sample run on this GPU the run replays, named by run id.

provider_namestringdefault: "Modal"

Provider whose listed rate prices the simulated cost.

usd_per_gpu_hourstring | null

That provider's listed rate per GPU-hour; null without one.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

served_runstring | null

Id of the verified sample run whose duration, metrics, outputs and log the run replays.

samplestringdefault: "lora"

Id of the gpu-router sample whose outputs the run serves.

stalebooleanrequired

True when the run is not terminal and its status was last checked (or, before any check, it launched or was accepted) more than 5 poll intervals ago.

provider_referenceobject | nullrequired

The Modal sandbox and app behind the run and its dashboard link; null when the run never launched.

Show child attributes
sandbox_idstringrequired
app_namestringrequired
dashboard_urlstringrequired
volume_namestringrequired
storage_urlstringrequired
spend_usdstringrequired

GPU cost of the job's finished runs so far.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

savingsobject | nullrequired

Full-job cost, benchmarks included, against the cheapest hourly GPU; null until a GPU is chosen.

Show child attributes
baseline_gpuenum<string>required

The usual default: the fitting GPU with the cheapest hourly rate.

Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300

baseline_cost_usdstring | nullrequired

The full job on the baseline at its current rate: (startup + work / measured throughput) x rate. The work is what the finished run did, or work_units before it finishes. Null when the baseline was not measured or the work is unknown.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

job_cost_usdstring | nullrequired

This job's GPU cost: its benchmark runs plus the full run, projected until the run finishes.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

saved_usdstring | nullrequired

baseline_cost_usd minus job_cost_usd; negative when benchmarking cost more than it saved.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

percentstring | nullrequired

saved_usd as a percent of baseline_cost_usd.

pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

outputs_urlstring | nullrequired

Lists the run's output files once it succeeded.

400application/json

IDEMPOTENCY_KEY_REQUIRED: the header is missing or empty. Nothing is stored.

IDEMPOTENCY_KEY_REQUIRED
401application/json

UNAUTHENTICATED: missing, invalid, expired, or revoked session or API key.

UNAUTHENTICATED
403application/json

CSRF_ORIGIN_MISMATCH: the Origin header does not match the public URL. DEMO_ACCOUNT_LIMITED: a demo account sent a job that is not a gpu-router sample.

CSRF_ORIGIN_MISMATCHDEMO_ACCOUNT_LIMITED
409application/json

JOB_OVER_BUDGET: the benchmark cap is above half of budget_usd, or the full run cannot fit what is left. PROVIDER_CONNECTION_REQUIRED, ROUTE_EXPIRED, or RUN_LIMIT_REACHED (fewer than 2 free run slots to benchmark) as for a run. No job is stored and nothing is launched.

JOB_OVER_BUDGETPROVIDER_CONNECTION_REQUIREDROUTE_EXPIREDRUN_LIMIT_REACHED
422application/json

VALIDATION_ERROR: malformed body, budget_usd missing or not positive, max_benchmark_gpus outside 2 to 3, or the timeout above the server limit. NO_COMPATIBLE_GPU: no GPU fits. GPU_INCOMPATIBLE: a gpus entry does not fit the job.

VALIDATION_ERRORNO_COMPATIBLE_GPUGPU_INCOMPATIBLE
429application/json

RATE_LIMITED (retryable): the signed-in user made more than GPU_ROUTER_RATE_PER_MINUTE mutating requests in the last minute. Nothing was changed.

RATE_LIMITED
500application/json

Unexpected failure: INTERNAL_ERROR.

INTERNAL_ERROR
502application/json

AUTH_PROVIDER_REJECTED: the provider refused the request (not retryable).

AUTH_PROVIDER_REJECTED
503application/json

AUTH_NOT_CONFIGURED (not retryable) or AUTH_PROVIDER_UNAVAILABLE (retryable).

AUTH_NOT_CONFIGUREDAUTH_PROVIDER_UNAVAILABLE

MCP tool

run_job: Run a container job on the cheapest GPU for it, in the user's own Modal account: Modal bills that account for GPU, CPU and memory time. The job is routed, benchmarked on 2 to 3 GPUs (short paid runs) unless recent measurements exist, and run on the GPU with the lowest verified cost per unit of work. If that launch fails to start (for example no capacity), the job falls back to the next cheapest verified GPU that fits the budget left, up to 2 times; a run that started and failed does not fall back. budget_usd is a hard cap on GPU spend for the whole job, benchmarks included; a job that cannot fit is refused (JOB_OVER_BUDGET) before anything starts. Ask the user before choosing a budget. Give image (an immutable container reference) and command (argv list), or sample=true with sample_id from list_samples (default lora) instead. env values are secret and never echoed. Some accounts get the sample simulated: nothing launched or billed. gpus is an optional shortlist (only these GPUs are benchmarked or run) and max_benchmark_gpus how many are benchmarked (2 or 3). Returns at once with the job in state routing or benchmarking; with wait=true it instead blocks like wait_for_job and returns the finished job's stats and agent_prompt. Reuse idempotency_key to retry safely without a second launch. To decide before paying, call route_job first.