Gateway

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.

GET/cap/{slug}

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

Path
slugstringrequired
Capability slug, e.g. token-price, token-search, trending-tokens, wallet-balances, gas-price, token-security, swap-quote, x-profile.
Query
{param}string
The capability's own parameters (listed by the capabilities endpoint below), e.g. token for token-price. Missing required ones return 400 with a missing list.
providerstring
Optional. Force one provider by API slug instead of automatic routing.

Request

bash
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.

200 OK
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... }
Response headers
X-Pikeway-Capabilitystring
The capability slug.
X-Pikeway-Routed-Tostring
API slug of the provider whose response you got.
X-Pikeway-Attemptsstring
Every provider tried, in order, as api: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-Cost
From the attempt that was returned, same as /gw.

Routing

  • 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, including 4xx, are returned as-is.

Errors

  • 400 missing required parameters (with missing).
  • 400 no provider could be called with these parameters every 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

GET/papi/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.

bash
curl https://<your-pikeway-site>/papi/capabilities
200 OK
[
  {
    "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.