Runs
Start run
Paid: launch the route's selected GPU, or the candidate named by gpu, in your Modal account. Needs an Idempotency-Key; a repeated key returns the first run without launching again.
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 | nullRequired and non-empty; missing or empty answers 400 IDEMPOTENCY_KEY_REQUIRED
Path parameters
idstringrequiredBody
providerstringrequiredProvider of the route candidate to launch. Only modal is supported, and it launches the route's selected GPU.
gpuenum<string> | nullLaunch this candidate GPU of the route instead of the selected one, such as the best measured probe; 422 GPU_INCOMPATIBLE when it is not a candidate.
Available options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300
Responses
202application/jsonThe stored run. Status is launching when the provider returned a reference, failed when the launch call raised, or lost when it timed out; a repeated Idempotency-Key for the same route returns the first run without launching again, in status accepted while that launch is still in flight.
Show response attributes
idstringrequiredroute_idstringrequireduser_idstringrequiredidempotency_keystringrequiredproviderenum<string>requiredAvailable options: modal lambda
gpuenum<string>requiredAvailable options: T4 L4 A10 L40S A100-40GB A100-80GB RTX-PRO-6000 H100 H200 B200 B300
provider_run_refstring | nullrequiredstatusenum<string>requiredAvailable options: accepted launching running succeeded failed cancel_requested cancelled lost
provider_confirmedbooleanrequiredWhether the provider observed the current status.
verification_statusenum<string>requiredAvailable options: not_requested pending passed failed
exit_codeinteger | nullrequiredlog_tailstring | nullrequiredcreated_atstring<date-time>requiredlaunched_atstring<date-time> | nullrequiredstarted_atstring<date-time> | nullWhen the provider first reported the run running or finished; null if it never started.
finished_atstring<date-time> | nullrequiredstatus_checked_atstring<date-time> | nullrequiredlast_errorstring | nullrequiredpoll_failuresintegerdefault: 0Consecutive 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 | nullThe benchmark protocol settings of a probe run; null for a job run.
Show child attributes
benchmark_idstringrequiredGroups the runs of one Benchmark my job request.
repeatintegerrequired1-based repeat of this run on its GPU.
runs_per_gpuintegerrequiredwork_stepsintegerrequiredSteps (training) or requests (inference) every run performs, sent as GPU_ROUTER_MAX_STEPS or GPU_ROUTER_MAX_REQUESTS.
seedintegerrequiredSent to every run as GPU_ROUTER_SEED.
max_secondsintegerrequiredSandbox timeout of every run.
loss_tolerance_pctstring | nullrequiredAllowed final-loss distance from the median across GPUs, in percent; null disables the check.
pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
cap_usdstringrequiredHard cap of the whole benchmark: rate x GPUs x max_seconds x runs_per_gpu, summed over GPUs.
pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
simulationobject | nullSet 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_secondsstringrequiredMeasured duration shown for the run, not its wall time.
pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
cost_usdstring | nullrequiredSimulated cost: duration_seconds at usd_per_gpu_hour of provider_name; nothing is billed.
pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
basisstringrequiredWhere 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 | nullThat provider's listed rate per GPU-hour; null without one.
pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
served_runstring | nullId 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.
stalebooleanrequiredTrue 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 | nullrequiredThe Modal sandbox and app behind the run and its dashboard link; null when the run never launched.
Show child attributes
sandbox_idstringrequiredapp_namestringrequireddashboard_urlstringrequiredvolume_namestringrequiredstorage_urlstringrequired400application/jsonIDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing or empty.
IDEMPOTENCY_KEY_REQUIRED401application/jsonUNAUTHENTICATED: missing, invalid, expired, or revoked session or API key.
UNAUTHENTICATED403application/jsonCSRF_ORIGIN_MISMATCH: the Origin header does not match the public URL.
CSRF_ORIGIN_MISMATCH404application/jsonROUTE_NOT_FOUND: no route with this id belongs to the signed-in user.
ROUTE_NOT_FOUND409application/jsonLAUNCH_NOT_SUPPORTED: the body names a candidate provider other than modal. ROUTE_NOT_SELECTED: the route selected no GPU. ROUTE_EXPIRED: the route's rate assumption has expired. PROVIDER_CONNECTION_REQUIRED: no Modal connection in status connected. RUN_LIMIT_REACHED: the user already has GPU_ROUTER_MAX_ACTIVE_RUNS runs in a non-terminal status. Nothing is stored.
LAUNCH_NOT_SUPPORTEDROUTE_NOT_SELECTEDROUTE_EXPIREDPROVIDER_CONNECTION_REQUIREDRUN_LIMIT_REACHED422application/jsonVALIDATION_ERROR: the route's job_spec.timeout_seconds is above this server's GPU_ROUTER_MAX_TIMEOUT_SECONDS. Nothing is stored.
VALIDATION_ERROR429application/jsonRATE_LIMITED (retryable): the signed-in user made more than GPU_ROUTER_RATE_PER_MINUTE mutating requests in the last minute. Nothing was changed.
RATE_LIMITED500application/jsonUnexpected failure: INTERNAL_ERROR.
INTERNAL_ERROR502application/jsonAUTH_PROVIDER_REJECTED: the provider refused the request (not retryable).
AUTH_PROVIDER_REJECTED503application/jsonPLATFORM_RUN_LIMIT_REACHED (retryable): all users together already have GPU_ROUTER_MAX_PLATFORM_ACTIVE_RUNS runs in a non-terminal status. Nothing is stored.
PLATFORM_RUN_LIMIT_REACHEDMCP tool
start_run: Launch a route as one full run in the user's own Modal account, which Modal bills for its GPU, CPU and memory time. Paid; confirm with the user first. Runs the route's selected GPU, or gpu when given (a candidate of the route, such as the best measured probe; GPU_INCOMPATIBLE otherwise). Reuse idempotency_key to retry without a second launch. Returns the run; get_run follows it, cancel_run stops it, list_outputs and download_output read what it wrote, get_verification checks it.