Capabilities
A capability is one action, such as “token price”, served by several providers with different paths and parameters. You call it with one set of parameters; the gateway picks the healthiest provider and fails over to the next one if a call fails.
Authentication
Same as /gw: Authorization: Bearer pk-…. Each attempt runs through the normal proxy flow (balance, rate limits, billing, logs) and you pay the price of the provider that actually served the result. Failed attempts are free.
Parameters
slugstringrequired{param}stringtoken for token-price. Missing required ones return 400 with a missing list.providerstringRequest
curl -i "https://gw.pikeway.ai/cap/token-price?token=WBTC" \ -H "Authorization: Bearer $PIKEWAY_API_KEY"
Response
The body is the serving provider's response, unchanged, so its shape depends on which provider answered. Check X-Pikeway-Routed-To.
HTTP/1.1 200 OK
Content-Type: application/json
X-Pikeway-Capability: token-price
X-Pikeway-Routed-To: pikeway-crypto
X-Pikeway-Attempts: pikeway-crypto:200
X-Pikeway-Call-Id: 0192f6a4-08d2-7c11-8a3e-2b6f0c9d1e47
X-Pikeway-Cost: 0.001
{ ...provider response... }X-Pikeway-CapabilitystringX-Pikeway-Routed-TostringX-Pikeway-Attemptsstringapi:status (or api:skipped when your parameters couldn't fill its path), e.g. dexscreener:502,pikeway-crypto:200.X-Pikeway-Call-Id · X-Pikeway-CostRouting
- Only live, public providers are candidates.
- Candidates are ranked by success rate over the last hour (providers with fewer than 5 calls count as healthy), then by p50 latency, then by the capability's default order.
- The next provider is tried when an attempt returns
5xx,429, or a 2xx whose business code is a failure. Other responses, including4xx, are returned as-is.
Errors
400 missing required parameters(with missing).400 no provider could be called with these parametersevery provider was skipped.404 unknown capability: {slug}·404 no live provider for capability {slug}405 GET only- Plus the /gw errors (401, 402, 429…) from the attempt that was returned.
List capabilities
The catalog of capabilities is served by the Pikeway web app (control API), not the gateway: GET /papi/capabilities for all, GET /papi/capabilities/{slug} for one. No key needed. Each entry lists its parameters and the live providers with their price and 30-day stats. Browse them on the Capabilities page.
curl https://<your-pikeway-site>/papi/capabilities
[
{
"slug": "token-price",
"title": "Token price",
"group": "Market data",
"description": "Current USD price of a token by symbol or address.",
"params": [
{ "name": "token", "label": "Symbol or contract address", "example": "WBTC", "required": true }
],
"providers": [
{
"api": "pikeway-crypto",
"name": "Pikeway Crypto",
"category": "Crypto",
"note": "median across sources",
"price": 0.001,
"billingType": "PER_CALL",
"successRate30d": 0.997,
"p50Latency30d": 240
}
]
}
]GET /papi/capabilities/{slug} returns 404 (capability not found) for unknown or disabled capabilities, or when none of its providers is live.