$npx -y skills add basezh/agent-skills-on-base --skill apinowDiscover APIs, fetch endpoint details/examples, execute paid calls, and run multi-step workflows on APINow with x402.
| 1 | # APINow Agent Skill |
| 2 | |
| 3 | Use this skill when the user asks to find APIs, inspect endpoint schemas/examples, pay for API calls, run multi-step workflows, or run with strict API allowlists and spend limits. |
| 4 | |
| 5 | ## Required Environment |
| 6 | |
| 7 | - Required for paid x402 calls: `APINOW_WALLET_PKEY` |
| 8 | - Optional paid fallback: `x-api-key` header with a funded APINow key |
| 9 | - Optional SIWA/CDP/managed signer paths: |
| 10 | - Privy: `PRIVY_APP_ID`, `PRIVY_APP_SECRET`, `PRIVY_WALLET_ID` |
| 11 | - Bankr/CDP-style agent wallet: `BANKR_API_KEY` |
| 12 | - Local private-key signer: `APINOW_WALLET_PKEY` |
| 13 | |
| 14 | If a paid call is requested and no valid payment auth is available, stop and ask the user to provide credentials. |
| 15 | |
| 16 | ## Capabilities |
| 17 | |
| 18 | 1) Discover APIs |
| 19 | - Semantic search: `POST /api/endpoints/semantic-search` |
| 20 | - Text search/listing: `GET /api/endpoints` |
| 21 | - Catalog listing: `GET /api/catalog` |
| 22 | - Endpoint details/schema: `GET /api/endpoints/{namespace}/{endpoint}/details` |
| 23 | - LLM-oriented examples: `GET /api/endpoints/{namespace}/{endpoint}/vibecode` |
| 24 | - Optional allowlist filters for both search APIs: |
| 25 | - `allowed_lists`: list slugs to restrict search scope |
| 26 | - `allowed_endpoints`: explicit endpoint keys (`namespace/endpoint`) |
| 27 | |
| 28 | 2) Execute paid API calls |
| 29 | - Endpoint invocation: `POST /api/endpoints/{namespace}/{endpoint}` |
| 30 | - Uses x402 (`402 -> sign -> retry`) with `APINOW_WALLET_PKEY`, or API key path. |
| 31 | |
| 32 | 3) Query lists and enforce list-only mode |
| 33 | - Browse lists: `GET /api/lists` |
| 34 | - Load list details/endpoints and treat as hard allowlist when the user requests list-restricted execution. |
| 35 | - Reject endpoint calls outside the active allowlist. |
| 36 | |
| 37 | 4) Workflows |
| 38 | - List workflows: `GET /api/workflows` |
| 39 | - Get workflow details: `GET /api/workflows/{workflowId}` |
| 40 | - Run a workflow: `POST /api/workflows/{workflowId}/run` |
| 41 | - Workflows chain multiple x402 endpoints into a DAG pipeline with a single payment + automatic splitting. |
| 42 | - Each workflow has: nodes (endpoint references with dependency graph), totalPrice (USDC), and splits (payment distribution to endpoint owners + creator). |
| 43 | - Optional query params for listing: `creator`, `status` (active|draft|all), `limit` |
| 44 | |
| 45 | 5) Spend controls |
| 46 | - Support request-scoped and session/day controls: |
| 47 | - `max_per_query_usd` |
| 48 | - `max_per_day_usd` |
| 49 | - Before each paid call, estimate/check endpoint price from details and enforce caps. |
| 50 | - If expected cost exceeds cap, stop and ask for confirmation or updated limits. |
| 51 | |
| 52 | 6) Signer support |
| 53 | - Private key (`APINOW_WALLET_PKEY`) default path. |
| 54 | - Managed signers (Privy/Bankr/CDP-style wallets) for SIWA/x402 setups where configured. |
| 55 | |
| 56 | ## Execution Policy (must follow) |
| 57 | |
| 58 | 1. Never execute paid calls without payment credentials. |
| 59 | 2. If allowlist mode is enabled, only call endpoints present in the selected list(s). |
| 60 | 3. If allowlist mode is enabled, apply the same restrictions to discovery (`/api/endpoints` and `/api/endpoints/semantic-search`) before ranking/returning results. |
| 61 | 4. Enforce `max_per_query_usd` and `max_per_day_usd` before every paid invocation. |
| 62 | 5. Always fetch endpoint details before first call in a workflow to confirm method, params, and price. |
| 63 | 6. Prefer returning: |
| 64 | - endpoint selected |
| 65 | - price |
| 66 | - auth method used (wallet or API key) |
| 67 | - response payload summary |
| 68 | |
| 69 | ## Recommended Workflow |
| 70 | |
| 71 | 1. Discover |
| 72 | ```bash |
| 73 | curl -X POST https://www.apinow.fun/api/endpoints/semantic-search \ |
| 74 | -H "Content-Type: application/json" \ |
| 75 | -d '{"query":"summarize long text","limit":5,"allowed_lists":["best-ai-tools"],"allowed_endpoints":["openai/chat"]}' |
| 76 | |
| 77 | curl "https://www.apinow.fun/api/endpoints?search=summarize&sortBy=popular&allowed_lists=best-ai-tools&allowed_endpoints=openai/chat" |
| 78 | ``` |
| 79 | |
| 80 | 2. Inspect details |
| 81 | ```bash |
| 82 | curl https://www.apinow.fun/api/endpoints/openai/chat/details |
| 83 | curl https://www.apinow.fun/api/endpoints/openai/chat/vibecode |
| 84 | ``` |
| 85 | |
| 86 | 3. Execute (wallet path) |
| 87 | ```javascript |
| 88 | import { createClient } from "apinow-sdk"; |
| 89 | |
| 90 | const apinow = createClient({ |
| 91 | privateKey: process.env.APINOW_WALLET_PKEY, |
| 92 | }); |
| 93 | |
| 94 | const result = await apinow.call("/api/endpoints/openai/chat", { |
| 95 | method: "POST", |
| 96 | body: { prompt: "Summarize this document" }, |
| 97 | }); |
| 98 | ``` |
| 99 | |
| 100 | 4. Execute (API key path) |
| 101 | ```bash |
| 102 | curl -X POST https://www.apinow.fun/api/endpoints/openai/chat \ |
| 103 | -H "Content-Type: application/json" \ |
| 104 | -H "x-api-key: YOUR_API_KEY" \ |
| 105 | -d '{"prompt":"Summarize this document"}' |
| 106 | ``` |
| 107 | |
| 108 | 5. Browse workflows |
| 109 | ```bash |
| 110 | curl "https://www.apinow.fun/api/workflows?status=active&limit=10" |
| 111 | curl https://www.apinow.fun/api/workflows/90931d9c8fb94df9 |
| 112 | ``` |
| 113 | |
| 114 | 6. Run a workflow (wallet path) |
| 115 | ```javascript |
| 116 | import { createClient } from "apinow-sdk"; |
| 117 | |
| 118 | const apinow = createClient({ |
| 119 | privateKey: process.env.AP |