Run an API
run_apiExecute an API by SKU with a normalized input payload. Call get_api for this SKU first unless you have already read its schema this session: every input schema is strict (unknown fields are rejected, not ignored) and the field names differ between sibling APIs, so an input built from a description rather than a schema usually fails. Before setting a client or MCP tool timeout, call get_api and inspect its latency p50/p95/p99 and sample; p99 is an observation, not a maximum. Requires a valid AnyAPI key as a Bearer token. Charges the USD wallet only on success. Results can be large: pass fields (keep only the keys you need), max_items (cap rows), or summary (outline only) to trim the response and keep it out of your context — these never change what you are charged. Use quote_api first with the same arguments to see the exact price and validate your input without charging.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jq | No | optional: a jq expression to reshape the result; its output replaces 'output' (multiple outputs collect into an array). Example: '.data | {title, description, md: .markdown[:3500]}'. Sandboxed 250ms/2MB budget; on failure the full result is returned with jqError. Does not change cost | |
| input | Yes | normalized input payload matching the API input schema | |
| fields | No | optional: keep only these keys on each result item (dotted paths like 'author.name' descend into nested objects). Shrinks the response without changing cost | |
| sku_id | Yes | the API SKU slug to execute | |
| context | Yes | Explain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization." | |
| summary | No | optional: return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost | |
| max_items | No | optional: cap the number of result items returned; a _truncated note reports how many were withheld. Does not change cost |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | optional nudge. 'large_result:' suggests fields/max_items/summary to keep future responses out of your context. 'paging_unavailable:' means this result came from a source that cannot return a nextCursor, so it may be INCOMPLETE and you cannot page further - re-run with requireCursor true (may cost more per request) if you need the full list | |
| error | No | safe AnyAPI failure code when durable work failed | |
| items | Yes | number of result rows returned. For per-result SKUs the per-item cost is charged against this; for input-priced SKUs (perItemUnit != result) the charge is per submitted input, independent of this count | |
| output | Yes | normalized output payload | |
| status | No | durable request status: queued, running, succeeded, failed, or expired | |
| costUsd | Yes | amount charged to the wallet in USD | |
| jqError | No | present only when a jq expression failed; output then holds the full unshaped result and this explains why the reshape did not apply | |
| provider | Yes | the provider serving the request (AnyAPI) | |
| replayed | Yes | true when this response replays an identical earlier call (same API, same input) from the last few minutes instead of running again: nothing new was executed and costUsd restates the original charge, it was NOT charged a second time | |
| resultId | No | opaque handle to the full result, cached ~15 min; pass it to read_result to dig deeper for free (no re-run, no charge). Absent when the result was too large to cache | |
| requestId | No | durable request identifier; pass it to get_request to resume without repeating the paid POST | |
| nextAction | No | machine-actionable resume instruction present while durable work is pending | |
| serviceOutcome | No | end-to-end AnyAPI service outcome when known | |
| settlementState | No | payment settlement state when known; independent of durable request status |