Run an endpoint
Call any endpoint by provider, endpoint and structured input. Pikeway builds the URL, query and body, runs it through the gateway with normal billing, and wraps the result in a run object. Synchronous by default; long jobs can run in the background.
Authentication
Authorization: Bearer pk-…. The call is billed exactly like /gw: only successful (2xx) upstream responses are charged.
Body
providerstringrequiredendpointstringrequiredmethodstringinputobjectasyncboolean202 immediately. Endpoints the provider marked as long-running tasks are always async.timeoutSecondsintegerInput formats
Structured: any of pathParams, queryParams, body, matching the schemas from /v1/inspect. Array values in queryParams become repeated parameters.
{ "pathParams": { "id": "42" }, "queryParams": { "limit": 10 }, "body": { "...": "..." } }Flat: a single object. Keys that match path placeholders go into the path; the rest become query parameters for GET/DELETE/HEAD, or the JSON body for other methods.
{ "address": "So11111111111111111111111111111111111111112" }Required path and query parameters are checked first; if any is missing you get 400 with the list and the full input schema, before anything is called or charged.
Request
curl -X POST https://gw.pikeway.ai/v1/run \
-H "Authorization: Bearer $PIKEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "birdeye",
"endpoint": "/defi/price",
"input": { "address": "So11111111111111111111111111111111111111112" }
}'Response
The HTTP status of a synchronous run is the provider's status. status is COMPLETED for responses below 400 and FAILED otherwise; output is the provider's body (parsed JSON, or a string).
{
"runId": "0192f6b0-5e2a-7d40-b1c3-8f9e2a4d6c11",
"provider": "birdeye",
"endpoint": "/defi/price",
"method": "GET",
"status": "COMPLETED",
"output": { "success": true, "data": { "value": 172.41, "updateUnixTime": 1761297120 } },
"providerResponse": { "httpStatus": 200, "contentType": "application/json", "cache": "" },
"price": { "type": "PER_CALL", "amount": { "value": 0.001, "currency": "USD" }, "notes": ["charged only when the upstream call succeeds (HTTP 2xx)"] },
"cost": { "value": 0.001, "currency": "USD" },
"durationMs": 214,
"hints": { "get": "curl -s https://gw.pikeway.ai/v1/runs/0192f6b0-5e2a-7d40-b1c3-8f9e2a4d6c11 -H 'Authorization: Bearer $PIKEWAY_API_KEY'" }
}runIdstringstatusCOMPLETED | FAILEDoutputanyproviderResponseobjectprice · costobjectdurationMsintegerResponse headers X-Pikeway-Call-Id, X-Pikeway-Cost, X-Pikeway-Cache and X-Pikeway-Byok are copied from the underlying call.
{"error": "insufficient balance", "statusCode": 402}.Async runs
Send "async": true to get 202 Accepted right away. The call runs in the background through the same gateway flow; poll GET /v1/runs/{runId} until status is no longer QUEUED or RUNNING. Async runs need a key, are kept for 7 days, and are not charged if they time out, are stopped or fail.
curl -X POST https://gw.pikeway.ai/v1/run \
-H "Authorization: Bearer $PIKEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider": "birdeye", "endpoint": "/defi/price", "input": {"address": "So111…"}, "async": true, "timeoutSeconds": 120}'{
"runId": "run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87",
"status": "QUEUED",
"provider": "birdeye",
"endpoint": "/defi/price",
"method": "GET",
"timeoutSeconds": 120,
"price": { "type": "PER_CALL", "amount": { "value": 0.001, "currency": "USD" }, "notes": ["…"] },
"pollUrl": "https://gw.pikeway.ai/v1/runs/run_5f0c2b7e9a4d4e1b8c3a6f2d1e0b9a87",
"hints": {
"get": "curl -s https://gw.pikeway.ai/v1/runs/run_5f0c… -H 'Authorization: Bearer $PIKEWAY_API_KEY'",
"stop": "curl -s -X POST https://gw.pikeway.ai/v1/runs/run_5f0c…/stop -H 'Authorization: Bearer $PIKEWAY_API_KEY'"
}
}Async run ids start with run_. Final statuses: COMPLETED, FAILED, STOPPED, TIMED_OUT. Output is stored up to 2 MB.
Errors
400missing required input(see below) ·provider and endpoint are required (see POST /v1/discover)·body must be JSON400async runs need an API key (x402 pays per synchronous run)401missing API key (Authorization: Bearer pk-...)·invalid or revoked API key403bring-your-own-key API without your key:{"code": 403, "message": "…", "byok": true, "signupUrl": "…"}404unknown provider: …·unknown endpoint … on …(with available)405use POST- Gateway rejections (402, 429, 503…) in the gateway shape.
{
"code": 400,
"message": "missing required input",
"missing": ["queryParams.address"],
"input": { "queryParams": { "type": "object", "properties": { "address": { "type": "string" } }, "required": ["address"] } }
}