Get started

Quickstart

Sign in, create an API key, and run the LoRA sample job from your agent, the CLI or curl.

By the end you will have a finished job: two GPUs benchmarked, a winner chosen by verified cost per 1k steps, a verified run, and its output files. The sample runs simulated, so nothing is launched or billed.

  1. Sign in#

    Open /sign-in and continue with email (a one-time code) or Google. Try a demo account gives you a temporary account with finished sample jobs; it is deleted after 24 hours.

  2. Create an API key#

    On the Developer access page, name a key and press Create key. The full key starts with gr_ and is shown once.

    export GPU_ROUTER_API_KEY=gr_...
    curl -s https://gpu-router.com/v1/me -H "Authorization: Bearer $GPU_ROUTER_API_KEY"
    {
      "id": "6837c4a8912b45aeb724d7197d273d70",
      "email": "alice@example.com",
      "email_verified": true,
      "created_at": "2026-10-14T04:10:29.887643Z",
      "demo": false
    }

    Keys can only be created and deleted from a signed-in browser session, so a leaked key cannot mint more keys.

  3. Run the sample#

    Pick one of the three ways. All of them call POST /v1/jobs with the spec from GET /v1/samples/lora and a budget.

    From your agent (MCP)#

    Add the MCP server as shown in Agents, then ask:

    run the lora sample with a $1 budget and wait

    The agent calls run_job(sample=true, budget_usd=1, wait=true). One call waits at most 50 seconds; if the job is still going it returns timed_out: true and the agent calls wait_for_job again. The finished result is the job's event, with an agent_prompt describing what happened.

    From the CLI#

    uvx --from git+https://github.com/sofiabod/gpu-router.git gpu-router login --base-url https://gpu-router.com
    gpu-router run --sample --budget 1 --wait

    Progress goes to stderr, one line per job step; the summary goes to stdout:

    routing: 5 GPUs fit with at least 16 GB of VRAM: T4, L4, A10, L40S, A100-80GB.
    benchmarking: Testing T4, L4: 2 capped runs each, up to USD 0.231600.
    choosing: Simulated benchmark, nothing launched or billed: T4 wins: $0.455423 per 1k steps (median of 2, range 0.362351 to 0.548495) vs L4 $0.502876; L4 tied with T4; wall-clock only, lower confidence.
    running: T4 has the lowest verified cost per 1k steps, $0.455423 of the 2 GPUs tested, vs L4 $0.502876.
    done: Finished and verified on T4.
    
    Job: 58afe5bc5ebd49c583399fd28991755d
    State: done
    Winner: T4 at USD 0.590400 per GPU-hour
    Why: T4 has the lowest verified cost per 1k steps, $0.455423 of the 2 GPUs tested, vs L4 $0.502876.
    Cost: USD 0.116723 of the USD 1 budget
    Saved: USD -0.096347 (-472.8%) vs the full job on T4, benchmarks included
    Outputs:
      gpu-router outputs a8b1e1e1e0b449eaaac8375342d3412f --get metrics.json
      gpu-router outputs a8b1e1e1e0b449eaaac8375342d3412f --get adapter/adapter_model.safetensors
      gpu-router outputs a8b1e1e1e0b449eaaac8375342d3412f --get adapter/adapter_config.json
      gpu-router outputs a8b1e1e1e0b449eaaac8375342d3412f --get adapter/README.md

    With curl#

    Fetch the sample spec, then post it as a job. Idempotency-Key is required: sending the same key again returns the same job instead of starting a second one.

    curl -s https://gpu-router.com/v1/samples/lora \
      | jq '{job_spec: (.env = {}), budget_usd: "1"}' \
      | curl -s -X POST https://gpu-router.com/v1/jobs \
          -H "Authorization: Bearer $GPU_ROUTER_API_KEY" \
          -H "Content-Type: application/json" \
          -H "Idempotency-Key: quickstart-1" \
          -d @-

    The answer is 202 with the job already benchmarking (trimmed):

    {
      "id": "ae6e2a4f889f4e5388c3cc1d1441c848",
      "state": "benchmarking",
      "budget_usd": "1",
      "max_benchmark_gpus": 3,
      "route_id": "9c97173b531840e2a3a4b78f5876b56e",
      "benchmarked": ["T4", "L4"],
      "choice": null,
      "steps": [
        {"state": "routing", "at": "2026-10-14T04:10:29.943300Z", "detail": "5 GPUs fit with at least 16 GB of VRAM: T4, L4, A10, L40S, A100-80GB."},
        {"state": "benchmarking", "at": "2026-10-14T04:10:29.946774Z", "detail": "Testing T4, L4: 2 capped runs each, up to USD 0.231600."}
      ],
      "spend_usd": "0",
      "savings": null,
      "outputs_url": null
    }

    Money is always a decimal string. Env values in the spec come back masked; send real values for your own jobs.

  4. Follow the job#

    Poll the job until state is done or failed. States run in order: routing, benchmarking, choosing, running, then done or failed.

    curl -s https://gpu-router.com/v1/jobs/$JOB_ID -H "Authorization: Bearer $GPU_ROUTER_API_KEY"
    gpu-router wait $JOB_ID

    Once it is finished, GET /v1/jobs/{id}/event returns the same payload a webhook gets. Before then it answers 409 JOB_NOT_FINISHED.

What you get back#

The finished event (trimmed):

{
  "id": "evt_87131c25caa15e6f9df86976b0ecbbbf",
  "type": "job.completed",
  "job_id": "c0c2e4aa09cf4b45a329c4f724df34a8",
  "run_id": "29441b0672bd4882a12b581d3fc09081",
  "stats": {
    "gpu": "T4",
    "machine": "T4 PCIe 16 GB",
    "status": "done",
    "verification": "passed",
    "runtime_seconds": "127.398312",
    "cost_usd": "0.020894",
    "usd_per_unit": "0.455423",
    "unit": "1k steps",
    "compared": [
      {"gpu": "T4", "machine": "T4 PCIe 16 GB", "usd_per_unit": "0.455423", "unit": "1k steps"},
      {"gpu": "L4", "machine": "L4 PCIe 24 GB", "usd_per_unit": "0.502876", "unit": "1k steps"}
    ],
    "spend_usd": "0.116723",
    "budget_usd": "1",
    "outputs": [
      {"path": "metrics.json", "download_url": "https://gpu-router.com/v1/runs/29441b0672bd4882a12b581d3fc09081/outputs/metrics.json"},
      {"path": "adapter/adapter_model.safetensors", "download_url": "..."}
    ],
    "simulated": true
  },
  "agent_prompt": "Your LoRA fine-tune job finished on T4 in 127 s for $0.020894 (verified). T4 beat L4 by 9.4% per 1k steps. Spent $0.116723 of the $1.00 budget. Net: cost $0.096347 more than running on the cheapest-hourly GPU (T4), because the benchmark cost $0.095829; next runs of this job skip the benchmark. ..."
}
FieldMeaning
stats.comparedVerified cost per unit of every GPU tested, cheapest first.
stats.spend_usdGPU cost of the benchmark runs plus the full run.
stats.savingsFull-job cost against the cheapest-hourly GPU, benchmarks included. It can be negative on a short job.
stats.outputsFiles the run wrote to output_dir. Download each with your bearer key.
agent_promptWhat happened and what to do next, written for an AI agent.

On a job this short the benchmark costs more than it saves. Running the same job again within 14 days reuses these measurements and skips the benchmark.

Run your own job#

A real job needs a Modal connection. Create a token at modal.com/settings/tokens, then connect it:

gpu-router connect modal --credential token_id=ak-... --credential token_secret=as-...
gpu-router run --image ghcr.io/you/train:1 --cmd "python train.py" --budget 5

Paid compute. This launches benchmark runs and a full run in your Modal account. --budget caps the GPU spend of the whole job; Modal also bills CPU and memory.

Without a Modal connection, a paid call answers 409 PROVIDER_CONNECTION_REQUIRED.

Next steps#