# REST reference

Every /v1 route, how a request maps to the provider's, the X-Kitepod headers, async polling and every error code.

Everything the MCP tools do is also plain HTTP under `https://kitepod.com/v1`. Answers from a provider come back unchanged; Kitepod's own facts travel in headers, and its own refusals are JSON `{error, message, …}`.

## Authentication

Send a team API key as `Authorization: Bearer kp_live_…`, or as `X-Kitepod-Token: kp_live_…` for clients that reserve Authorization. The REST API takes API keys only, not OAuth tokens. The catalog routes need no key and answer any origin.

```sh
export KITEPOD_API_KEY=kp_live_…
curl -s https://kitepod.com/v1/balance -H "Authorization: Bearer $KITEPOD_API_KEY"
```

200:

```json
{
  "balance_micro": 999010,
  "held_micro": 0,
  "balance_usd": "0.99901",
  "held_usd": "0",
  "topup_url": "https://kitepod.com/team?tab=billing"
}
```

## Routes

| Route | Key | Does |
| --- | --- | --- |
| `GET /v1/catalog/search?q=…&limit=…` | no | Search by the job. `limit` defaults to 10, at most 25. |
| `GET /v1/catalog/endpoints/{id}` | no | One endpoint with its parameters, price, example and stats. |
| `GET /v1/catalog/providers` | no | Every provider. |
| `GET /v1/catalog/providers/{slug}` | no | One provider and its endpoints. |
| `ANY /v1/call/{endpoint-id}` | yes | Call a catalog endpoint, with the method it declares. |
| `ANY /v1/call/{tool}/{path…}` | yes | Call your team's own HTTP tool. |
| `GET /v1/call/{tool}` | yes | List an own MCP server's tools. |
| `POST /v1/call/{tool}/{mcp-tool}` | yes | Call one tool on an own MCP server; the JSON body is its arguments. |
| `GET /v1/calls/{call_id}/result` | yes | An earlier call's stored result, or an async job's state. |
| `GET /v1/balance` | yes | Balance, held amount and the top-up link. |
| `GET /v1/usage?tag=…&from=…&to=…` | yes | Spend grouped by one tag key's values. See [Teams](https://kitepod.com/docs/teams.md#project-tags-and-usage). |

## Calling a catalog endpoint

`/v1/call/{endpoint-id}` forwards your request to the provider with Kitepod's key (or your team's) added:

- **Method.** Use the one the endpoint lists; another answers `405 method_not_allowed`.
- **Query string.** Passed through unchanged.
- **Path parameters** (such as `{id}` in `/crawl/{id}`) go in the query string under their own name. Kitepod takes them out and puts them in the path.
- **Body.** Passed through unchanged. When the endpoint declares body parameters it must be JSON; a `json-array` endpoint (DataForSEO) takes an array holding one task object.
- **Headers.** Passed through, except `Authorization`, cookies, `X-Kitepod-*`, `cf-*`, hop-by-hop and forwarding headers.
- **Tags.** `X-Kitepod-Meta: customer=acme,run=42` tags the call for usage and project budgets; it isn't forwarded.
- Declared parameters are checked first; undeclared ones pass through as they are.

```sh
curl -X POST "https://kitepod.com/v1/call/firecrawl.web.scrape" \
  -H "Authorization: Bearer $KITEPOD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","formats":["markdown"]}'
```

A path parameter: `firecrawl.web.crawl.status` is `GET https://api.firecrawl.dev/v2/crawl/{id}`, so `id` goes in the query string:

```sh
curl -X GET "https://kitepod.com/v1/call/firecrawl.web.crawl.status?id=00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer $KITEPOD_API_KEY"
```

## Response headers

| Header | When | Meaning |
| --- | --- | --- |
| `X-Kitepod-Call-Id` | every call | The call's id, for `/v1/calls/{call_id}/result`, Activity and `feedback`. |
| `X-Kitepod-Cost-Micro` | every call | What this call cost, in micro-USD. `0` for a failure, an async job still running, your own key and own tools. |
| `X-Kitepod-Async` | async calls | `pending`: the job was accepted and Kitepod is polling it. |
| `X-Kitepod-Error` | Kitepod refusals | `1` when the error is Kitepod's, not the provider's. Without it, a 4xx or 5xx body is the provider's. |
| `X-Kitepod-Truncated` | stored results | `1` when the stored copy was cut at 64 KB. |
| `Retry-After` | `provider_capacity`, daily caps | Seconds to wait: until the provider has capacity, or until midnight UTC when a cap resets. |
| `Allow` | `method_not_allowed` | The method the endpoint takes. |

The provider's own headers pass through, minus cookies, hop-by-hop headers and its content encoding.

## Async calls and polling

Some endpoints start a job (`firecrawl.web.crawl`). On Kitepod's key the call answers at once with the provider's job answer, `X-Kitepod-Async: pending` and `X-Kitepod-Cost-Micro: 0`. The hold stays open; Kitepod polls the job and settles the cost when it ends. Read it with:

```sh
curl -s https://kitepod.com/v1/calls/call_8b0f3c6a2d4e4f1a9c7b5e3d1f0a2b4c/result -H "Authorization: Bearer $KITEPOD_API_KEY"
```

- **Running:** `202` with `{"status": "pending", "message": "Still running. Poll again in a few seconds."}` and `X-Kitepod-Async: pending`. Poll every few seconds.
- **Done:** the provider's final answer, its status and content type, and `X-Kitepod-Cost-Micro` with the settled cost.
- **Failed or expired:** `200` with `"status": "failed"` or `"expired"` and a message. Nothing is charged.

The job's status endpoint, `firecrawl.web.crawl.status`, can also be called directly: it is free and answers only for jobs your team started. On your team's own key Kitepod doesn't poll: you get the provider's job id and read its status endpoint yourself. The result route works for any call, async or not, for 30 days.

## Errors

A provider's own errors pass through with its status and body, without `X-Kitepod-Error`. A provider 5xx or timeout costs nothing; a provider 4xx costs nothing unless the endpoint's price notes that the provider bills it. Kitepod's refusals are JSON with `error` and `message`, and some add fields:

402, firecrawl.web.crawl at its default size:

```json
{
  "error": "insufficient_balance",
  "message": "This call can cost up to $9.9 and the team's balance is $0.99901. Top up at https://kitepod.com/team?tab=billing, or ask for fewer results.",
  "balance_micro": 999010,
  "estimated_cost_micro": 9900000,
  "topup_url": "https://kitepod.com/team?tab=billing"
}
```

| Code | HTTP | Meaning | What to do |
| --- | --- | --- | --- |
| `catalog_parameter_invalid` | 400 | A declared parameter is missing, of the wrong type or not one of its allowed values, or the body isn't the JSON the endpoint takes. `param` names it. | Read the endpoint with `catalog_get` and fix that parameter. Nothing was charged. |
| `meta_invalid` | 400 | `X-Kitepod-Meta` (or MCP `meta`) isn't up to 5 `key=value` tags with valid keys and values. | Fix the tags as the message says. |
| `tag_required` | 400 | `/v1/usage` without a valid tag key. | Pass `tag=` with the key, e.g. `customer`. |
| `range_invalid` | 400 | `/v1/usage` `from`/`to` aren't YYYY-MM-DD, or `from` is after `to`. | Fix the dates. |
| `invalid_request` | 400 | `/v1/catalog/search` without `q`. | Pass the job as `q`. |
| `invalid_arguments` | 400 | The body sent to an own MCP tool isn't a JSON object. | Send the tool's arguments as one JSON object. |
| `own_tool_path_invalid` | 400 | The path climbs out of the own tool's base URL. | Use a path under the base URL. |
| `own_tool_body_invalid` | 400 | The own tool injects a credential into the JSON body, and the body isn't a JSON object. | Send a JSON object body. |
| `unauthorized` | 401 | No API key, or a wrong or revoked one. | Send `Authorization: Bearer kp_live_…`. A person creates keys under Team → API keys (https://kitepod.com/team). |
| `insufficient_balance` | 402 | The team's balance is below what the call may cost. Has `balance_micro`, `estimated_cost_micro` and `topup_url`. | Tell the person the cost and the balance and give them `topup_url`; or ask for fewer results. |
| `project_budget_exceeded` | 402 | A project tag on this call (`X-Kitepod-Meta` or `meta`) would go over its budget. Has `project`, `tag`, `budget_micro`, `spent_micro` and `estimated_cost_micro`. | Tell the person; an owner or admin raises the budget. |
| `own_tool_refused` | 403 | The own tool's URL doesn't resolve only to public addresses. | An owner or admin fixes the tool's URL. |
| `tool_denied` | 403 | A team rule denies this provider, endpoint or capability to this member or agent, or it isn't on their allow list. Has `rule_id`. | Pick another endpoint, or ask an owner or admin. |
| `not_found` | 404 | No such catalog endpoint or provider on `/v1/catalog`, or no such `/v1` route. | Search the catalog. |
| `endpoint_not_found` | 404 | No catalog endpoint by that id. | Find one with `catalog_search`. |
| `tool_not_found` | 404 | The id has a slash, but the team has no own tool by the part before it. | List own tools with `my_tools`. Catalog ids have no slash. |
| `call_not_found` | 404 | No call with that id in the team's last 30 days. | Check the `call_id`. |
| `job_not_found` | 404 | A job status endpoint was asked about a job the team didn't start through Kitepod. | Use the job id from your own call, or read the result with `call_result`. |
| `method_not_allowed` | 405 | The endpoint takes another HTTP method; `allowed` and the `Allow` header name it. Own MCP tools take GET (list) and POST (call). | Use that method. |
| `endpoint_not_callable` | 409 | Kitepod can't charge for this endpoint on its own key (no USD price), or its upstream is an MCP server. | Connect your team's own key for the provider, or pick another endpoint. |
| `connection_broken` | 409 | Your team's key for this provider was refused by the provider and is marked broken. Nothing was sent or charged. Has `provider`. | Tell the person; an owner or admin reconnects or removes the key at /connections. |
| `own_tool_secret_missing` | 409 | A secret the own tool injects was deleted. | An owner or admin binds another secret. |
| `daily_call_cap` | 429 | This member or agent has made its metered calls for the day. Has `scope`, `cap`, `used`, `resets_at` and `Retry-After`. | Stop and tell the person; the cap resets at midnight UTC, and an owner or admin can raise it. |
| `daily_spend_cap` | 429 | This member, agent or the whole team would go over its daily spend cap with this call. Has `scope`, `cap_micro`, `used_micro`, `estimated_cost_micro`, `resets_at` and `Retry-After`. | Stop and tell the person; ask for less, or wait for the reset at midnight UTC. |
| `internal` | 500 | Kitepod failed. | Retry later. A call that failed here was not charged. |
| `upstream_too_large` | 502 | The provider's answer was over 8 MiB, the most Kitepod buffers for a metered call (4 MiB for an own MCP tool). | Ask for less. Nothing was charged. |
| `upstream_unreachable` | 502 | Kitepod couldn't reach the provider or own tool. | Retry later. Nothing was charged. |
| `upstream_redirect` | 502 | An own tool answered with a redirect, which Kitepod never follows. | Point the tool's URL at the final address. |
| `upstream_mcp_error` | 502 | An own MCP server refused the handshake or answered with a JSON-RPC error. | Check the tool's URL and credential. |
| `provider_unavailable` | 503 | Kitepod has no key for this provider right now. | Connect your team's own key, or pick another provider. |
| `provider_capacity` | 503 | The provider is at its rate limit on Kitepod's key, or was failing and calls are paused. Has `retry_after_s` and `Retry-After`. | Wait that long, then retry. |
| `secrets_unavailable` | 503 | Your team's stored keys can't be read right now. | Retry later. Nothing was sent or charged. |
| `upstream_timeout` | 504 | The provider or own tool didn't answer in time. | Retry later. Nothing was charged. |

Over MCP the same codes come back as tool errors. MCP adds `no_team` (the account has no team), `not_found` (`catalog_get` with an unknown id) and `invalid_input` (an own HTTP tool's input isn't `{method, query, body}`).

---

Docs: [Overview](https://kitepod.com/docs.md) · [Quickstart](https://kitepod.com/docs/quickstart.md) · [How it works](https://kitepod.com/docs/how-it-works.md) · [MCP reference](https://kitepod.com/docs/mcp.md) · [REST reference](https://kitepod.com/docs/rest.md) · [Billing](https://kitepod.com/docs/billing.md) · [Your own keys](https://kitepod.com/docs/your-keys.md) · [Your own tools](https://kitepod.com/docs/own-tools.md) · [Teams](https://kitepod.com/docs/teams.md) · [Catalog format](https://kitepod.com/docs/catalog-format.md)

[Tools](https://kitepod.com/tools) · [Pricing](https://kitepod.com/pricing) · [Sign up](https://kitepod.com/login) · [llms.txt](https://kitepod.com/llms.txt)
