> For the complete documentation index, see [llms.txt](https://infinitode-docs.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitode-docs.gitbook.io/documentation/api-documentation.md).

# API Documentation

View our API documentation.

## Get started with APIs

Choose an endpoint from the navigation, then send a request with your API key. Each endpoint page defines its required parameters, response shape, rate limits, and examples.

While you're building, test your requests in the [API playground](https://infinitode.netlify.app/api/playground): mock mode needs no key and uses no calls.

<a href="https://infinitode.netlify.app/openapi" class="button primary" data-icon="file-code">Browse OpenAPI specifications</a>

## Types of API calls

Every endpoint takes one kind of call, authenticated with your account's **standard API key** (`INF-`). A call returns the endpoint's actual output, and each one uses a call from your plan's monthly allowance or from the calls you've bought.

One key covers testing and production alike. To check a request before you spend a call on it, send it through the [API playground](/documentation/api-documentation/api-playground.md) in **mock mode**.

{% hint style="info" %}
Our APIs will always default to the latest version available. The endpoint URL does not include the API version.\
You cannot switch between different API versions, as we only maintain the most recent stable version on our servers.
{% endhint %}

{% hint style="info" %}
You can view more information, and questions about APIs, here:\
[Questions about APIs](https://infinitode-docs.gitbook.io/faqs/questions-about-apis)
{% endhint %}

***

## :test\_tube: API Playground

The [API playground](https://infinitode.netlify.app/api/playground) runs in your browser and lets you try any endpoint before you write code. Pick an endpoint, fill in its parameters, and choose how the request is sent:

| Mode | What it does                                                                                                                                   | Uses a call?                                              |
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| Mock | Returns **dummy data in the real response shape** — the same status codes and the same error messages as the live endpoint. No API key needed. | No                                                        |
| Live | Sends the request to the real endpoint with your **standard API key** and shows the precise response: status, headers, timing and body.        | Yes — one call, exactly like a request from your own code |

Mock responses are for building and testing your integration: if your code handles the mock response, it handles the live response. When you want the actual result for the parameters you entered, switch to live mode — the call is metered like any other request, and [errors](#error-responses) come back in the same format.

See [API playground](/documentation/api-documentation/api-playground.md) for both modes, the machine interface, and how to migrate from developer keys.

***

## Plans and limits

Every account has a monthly allowance of API calls.

| Plan       | Price        | API calls / month |
| ---------- | ------------ | ----------------- |
| Free       | $0           | 250               |
| Business   | $9 / month   | 25,000            |
| Enterprise | Custom quote | 250,000+          |

Prices are in USD and checkout is handled by PayPal. Free allowances reset on the 1st of each month. Business allowances are refilled only after PayPal confirms the renewal payment, on the same day each month — unused monthly calls don't roll over.

Enterprise is contact-only: there's no online checkout, and the volumes above are indicative starting points for a written quote rather than a self-service plan. See [Account, security & billing](/documentation/account-security-billing.md#plans-and-allowances) for how a Business subscription starts, renews and ends.

### Top-up packs (calls that never expire)

Need more calls without changing plan? Buy a pack from your account page. It works on any plan, including Free.

| Pack    | Price | API calls |
| ------- | ----- | --------- |
| Boost   | $5    | 10,000    |
| Builder | $15   | 35,000    |
| Scale   | $40   | 100,000   |

* **Bought calls never expire.** They stay on your account through resets, plan changes and cancellations.
* **Your monthly allowance is always used first.** Bought calls are only used after it runs out, so they last as long as possible.
* A single balance covers every request: live requests from your own code and from the API playground's live mode draw on the same calls.
* Prices are in US dollars and payment is handled by PayPal.
* **Unused packs can be refunded within 14 days** of the payment being confirmed — only if your bought-call balance still covers the whole pack. Approved refunds remove that pack's calls from your balance; see the [Refund Policy](https://infinitode.netlify.app/legal/refund-policy).
* **Subscription charges are not refundable**, in whole or in part, except where applicable law requires otherwise. Cancelling Business stops the next renewal and keeps paid access until the end of the period you've paid for.
* **There's no pay-per-call overage charge.** When your allowance and bought calls are used up, requests return `401` until your allowance resets, you upgrade, or you buy a pack.

***

## :key: API Authentication

Our APIs require your **standard API key** (`INF-`). It's created when you sign up, and it's the only key your account has: one balance covers every endpoint, drawing on your plan's monthly allowance first and then any calls you've bought. The standard key is shown on your account dashboard once you've verified your email address.

Once you have it, use it for live requests — and when you'd rather not spend a call, test the same request in [mock mode](/documentation/api-documentation/api-playground.md#mock-mode), which needs no key.

{% hint style="warning" %}
Your key is revealed on your account page only after you **verify your email address**. Until then, verification also blocks purchases, authenticator enrolment and key resets. See [What email verification unlocks](/documentation/account-security-billing.md#what-email-verification-unlocks).
{% endhint %}

#### Resetting your key

If your key leaks, you can replace it yourself — no support ticket needed. Your key has a **Reset** button on your account page, usable up to **3 times in a rolling seven-day window**, and the old key stops working the moment you press it. A reset requires a verified email address and a recent sign-in. See [Keeping your API key safe](/documentation/api-documentation/keeping-your-api-key-safe.md#reset-a-leaked-key-yourself).

#### API call history

Your account page lists every call made with your key for the **last 30 days**: the endpoint you hit, the method, the response status and error message, and whether the request used a call. Filter by time, navigate with the chart, and export the results as **CSV or JSON** — up to 5,000 entries per query. See [See what your keys were used for](/documentation/api-documentation/keeping-your-api-key-safe.md#see-what-your-keys-were-used-for).

Activity entries may show the final three characters of the key used and whether it was active, the result category, an approximate country and city, and an origin or referrer. The full key and your raw IP address are never stored.

#### Error responses

| Status                                       | Meaning                                                                                                  | Uses a call? |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------ |
| `400`                                        | Missing or invalid parameters                                                                            | No           |
| `405`                                        | Wrong HTTP method                                                                                        | No           |
| `429` `{"error": "Rate limit exceeded"}`     | Rate limit exceeded (25 requests per minute per key)                                                     | No           |
| `401` `{"error": "Invalid API key."}`        | The key is wrong, revoked, replaced by a reset, is a removed `DEV-` key, or is missing its `INF-` prefix | No           |
| `401` `{"error": "No remaining API calls."}` | Your monthly allowance **and** your bought calls are used up                                             | No           |
| `401` with another message                   | The request was accepted but failed while processing (e.g. an invalid expression)                        | **Yes**      |

When you see "No remaining API calls.", wait for your reset date, upgrade to Business, or buy a [top-up pack](#top-up-packs-calls-that-never-expire).

{% hint style="danger" %}
If your API key is compromised, reset it yourself from your account page — you don't need to wait for support. Your key has a **Reset** button, usable up to 3 times in a rolling seven-day window, and the old key stops working the moment you press it. A reset needs a verified email address and a recent sign-in. Check your [API call history](/documentation/api-documentation/keeping-your-api-key-safe.md#see-what-your-keys-were-used-for) to see what was done with the leaked key, then update your deployment. Calls it already spent, including bought calls, can't be restored. Treat your API key like a password. Anyone who has it can spend your calls, including calls you paid for.
{% endhint %}
