pikeway runs get
Fetch one run: its status, upstream HTTP code, cost, duration and, for background runs, the output.
Synopsis
pikeway runs get -r <run-id> [-o <file>] [--json] pikeway runs get <run-id>
Description
Reads GET /v1/runs/<id>. Works for both kinds of run id: background runs (run_…, from pikeway run --async) and synchronous calls (the UUID printed by pikeway run).
Background runs keep their output, so this is how you collect the result of an --async run. Synchronous calls return their output only once, in the pikeway run response; here you get the status and cost, plus a note that the output was not retained.
Unlike pikeway run, this command exits 0 whatever the run's status is, as long as the run was found. Check status in the JSON if you need to branch on it. Needs a key.
Options
--run, -rstringrequired--output, -opathExamples
# check on a background run pikeway runs get -r run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87 # positional id pikeway runs get run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87 # save the finished output pikeway runs get -r run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87 -o report.json # poll from a script until it's done while [ "$(pikeway runs get -r "$RUN" --json | jq -r .status)" = RUNNING ]; do sleep 5; done
Output
COMPLETED birdeye GET /defi/price
HTTP 200 · cost $0.001 · 640ms · 2026-10-24T09:20:00Z
{
"success": true,
"data": { "value": 172.41 }
}COMPLETED birdeye GET /defi/price HTTP 200 · cost $0.001 · 214ms · 2026-10-24T09:12:03Z (output not retained — runs return their output synchronously; use -o with `pikeway run` to save it)
A run that is still going shows RUNNING and HTTP — / —ms. If the run failed or was stopped, its error is appended to the second line, e.g. · stopped by user. With -o the output is written to the file and not printed.
--json
{
"runId": "run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87",
"async": true,
"provider": "birdeye",
"method": "GET",
"endpoint": "/defi/price",
"status": "COMPLETED",
"input": { "address": "So11111111111111111111111111111111111111112" },
"providerResponse": { "httpStatus": 200 },
"output": { "success": true, "data": { "value": 172.41 } },
"cost": { "value": 0.001, "currency": "USD" },
"timeoutSeconds": 120,
"createdAt": "2026-10-24T09:20:00Z",
"startedAt": "2026-10-24T09:20:00Z",
"finishedAt": "2026-10-24T09:20:01Z",
"durationMs": 640,
"pollUrl": "https://gw.pikeway.ai/v1/runs/run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87"
}For a synchronous call there is no output; instead outputRetained is false and the path is in path.
Errors and exit codes
| Exit | Message | When |
|---|---|---|
| 2 | usage: pikeway runs get -r <run-id> | No -r and no positional id. |
| 1 | run not found | No run with this id on your account. |
| 3 | no API key: run `pikeway keys add --label main --key pk-...`, set PIKEWAY_API_KEY, or pass --key | No --key, no PIKEWAY_API_KEY and no saved active key. Checked before any request is sent. |
| 3 | invalid or revoked API key — add a key with `pikeway keys add --label main --key pk-...` (or use --x402) | The gateway answered 401 (unknown, revoked or expired key). A 403 also exits with 3. |
| 1 | cannot reach <gateway>: ECONNREFUSED | The gateway could not be reached (DNS, network, wrong PIKEWAY_API_BASE_URL). The code after the colon comes from Node. |
--async.