---
name: pikeway
version: 0.2.0
description: >-
  Pay-per-call access to live data and APIs through one key or a USDC wallet: token prices, DEX pairs,
  wallets and on-chain activity, X/Twitter profiles and tweets, Google / web search and scraping (with the
  user's own Exa, Firecrawl, Serper or Apify key), and 350 LLMs. Proactively run `pikeway discover`
  before writing a scraper, before calling an unfamiliar public API by hand, or before telling the user
  some data is unavailable, and whenever the user mentions token prices, wallets, on-chain data, crypto
  social sentiment or "pikeway". If the user already has a dedicated tool, MCP server or key for that exact
  service, use that instead: Pikeway fills gaps, it doesn't replace what they have.
---

# Pikeway

Pikeway lets you find an API for a task, see its inputs and price, and call it, all through one interface.
Discovery is free. Calls are billed per successful call (failed calls are free) from the user's Pikeway
balance, or paid per run from a wallet with x402.

Site: https://pikeway.ai. Gateway: https://gw.pikeway.ai.

---

## Setup

Run `pikeway --version`. **Do the steps below if** the command is not found, or it prints anything other than `0.2.0`
(the CLI and this skill must always be the same version; never downgrade either one).

1. Install or update the CLI (Node 18+), then run setup:

```bash
npm install -g https://pikeway.ai/sdk/pikeway-cli.tgz
pikeway setup --client <your agent name if known: claude-code | codex | cursor | opencode | other>
```

   `pikeway setup` checks versions, verifies the key if one is saved, saves this skill where your client loads
   skills (Claude Code: `~/.claude/skills/pikeway/SKILL.md`, Codex: `~/.codex/skills/pikeway/SKILL.md`) and prints the
   MCP command for your client. For other clients, save https://pikeway.ai/SKILL.md into your skills / rules directory yourself
   so it loads in future sessions.

2. **API key.** If `pikeway whoami` fails:
   - Ask the user to create a key at https://pikeway.ai/console/keys (sign in with email or a wallet) and paste it.
   - Save it: `pikeway setup --key <their-key>` (or `pikeway keys add --label main --key <their-key>`). Never echo the key back.
   - If you'll run calls unattended, suggest a key limited to what the task needs (Console → Keys → New key):
     permissions "Call APIs" only (and only the APIs it uses), a spending cap and an expiry.
     `pikeway whoami` shows a key's scopes, expiry and budget.

3. **No CLI? Use MCP instead.** Clients that support MCP sign-in need no key at all:
   - Claude Code: `claude mcp add --transport http pikeway https://gw.pikeway.ai/mcp/agent`, then `/mcp` → pikeway → Authenticate.
   - Codex: `codex mcp add pikeway --url https://gw.pikeway.ai/mcp/agent`.
   - Claude.ai / ChatGPT: add a custom connector with URL `https://gw.pikeway.ai/mcp/agent`.
   - Tools: `pikeway_discover`, `pikeway_inspect`, `pikeway_run`, `pikeway_get_run`. The ready-made task prompts appear as MCP prompts.

Use `--json` and `NO_COLOR=1` when you parse CLI output.

---

## When to use Pikeway

- You need live or external data: prices, charts, pools, holders, wallet portfolios and PnL, transactions,
  smart-money trades, swap quotes, gas, DeFi TVL, X/Twitter profiles / tweets / KOLs, web search or page text.
- You were about to write a scraper or guess an undocumented public API.
- You were about to say "I can't access that".

## When not to

- The user already has a dedicated tool / key for that service: use it.
- Static knowledge you already have, or anything the user's own files answer.
- The task would need more than ~$1 of calls: say what it will cost and ask first.

---

## Workflow

```bash
# 1. Find endpoints (free, ranked by relevance, reliability and price)
pikeway discover -q "trending tokens on solana" --json

# 2. Read the input schema, an example input and the price (free)
pikeway inspect -p <provider> -e '<endpoint>' --json

# 3. Run it. Input is a flat object, or {pathParams, queryParams, body} as inspect shows
pikeway run -p <provider> -e '<endpoint>' -i '<json>' --json

# Long jobs: start in the background, then poll (stopped and timed-out runs are free)
pikeway run -p <provider> -e '<endpoint>' -i '<json>' --async --timeout 300 --json
pikeway runs get -r <runId> --json        # or: --wait instead of --async to block until done

# Money
pikeway balance --json
```

A run returns `status` (`COMPLETED` or `FAILED`), `output` (the API's response), `cost.value` (USD) and `runId`.
`FAILED` means the upstream returned an error: it was not billed; read `output` and `providerResponse.httpStatus`, fix
the input or try the next discover result.

**Ready-made tasks:** `pikeway examples` lists tested prompts (token due diligence, wallet profile, market brief,
KOL radar, swap check…) with the endpoints they use and what they cost. `pikeway examples <slug>` shows one.

---

## Rules

- **Say what it costs.** Prices are in discover / inspect (`price.amount.value` USD per call). Before running more than
  ~20 calls or anything above $0.05 per call, tell the user the estimate. Report the total cost at the end.
- **Bring-your-own-key endpoints** (`price.type: BYOK`, e.g. Exa, Firecrawl, Serper, Apify) run on the user's own account
  with that provider: they add the key once at https://pikeway.ai/console/connections. Pikeway doesn't charge for them.
- **Errors:** `401` no / bad key (setup step 2) · `402` balance or key limit reached (user tops up at https://pikeway.ai/console/billing)
  · `403` with `byok` needs the user's own provider key · `403` with `missing scope` / `can't call`: this key
  isn't allowed to do that (permissions set by the user); don't retry, tell the user which scope or API it needs · `400` with `missing`: add those inputs (inspect shows them) ·
  `429` wait for `Retry-After` · `404` wrong provider / endpoint: run discover again.
- **Don't hammer.** At most 3 attempts per call; prefer one well-formed call over many guesses.
- **Cite sources.** Say which endpoint each number came from.
- **Pay from a wallet (x402)** only if the user asks and `https://gw.pikeway.ai/health` shows `x402.enabled: true`:
  `PIKEWAY_WALLET_PRIVATE_KEY=0x… pikeway run … --x402 --max-pay 0.05` (USDC on Base; no account needed).

---

## Without the CLI (plain HTTP)

```bash
curl -s -X POST https://gw.pikeway.ai/v1/discover -H 'content-type: application/json' -d '{"query":"token price on solana"}'
curl -s -X POST https://gw.pikeway.ai/v1/inspect  -H 'content-type: application/json' -d '{"provider":"…","endpoint":"…"}'
curl -s -X POST https://gw.pikeway.ai/v1/run      -H 'content-type: application/json' -H "Authorization: Bearer $PIKEWAY_API_KEY" \
     -d '{"provider":"…","endpoint":"…","input":{…}}'
```

Also: `GET https://gw.pikeway.ai/v1/runs/<runId>`, `GET https://gw.pikeway.ai/v1/wallet/balance`, `GET https://gw.pikeway.ai/v1/examples`, `GET https://gw.pikeway.ai/llms.txt`.
