> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> REST API overview — base URL, authentication, rate limits, response envelope, and error model.

anyformat exposes a REST API that lets you programmatically create [workflows](/concepts/workflows), process documents, and retrieve [results](/concepts/runs-and-results). This page is the orientation guide — for a step-by-step walkthrough, see the [quickstart](/guides/quickstart).

For terminology (Workflow, Field, Run, etc.) start at [Concepts](/concepts/workflows). For complete worked examples (invoices, resumes, contracts, …) see [Recipes](/guides/recipes/index).

***

## Base URL

```
https://api.anyformat.ai/
```

All v2 endpoints use the `/v2/` prefix — for example, `https://api.anyformat.ai/v2/workflows/`.

All endpoint paths require a trailing slash. Requests without one receive a `301 Moved Permanently` redirect.

***

## Authentication

All endpoints (except `/docs/` and `/schema/`) require an API key, passed as a Bearer token:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.anyformat.ai/v2/workflows/
```

See [Authentication](/api-reference/authentication) for how to obtain and manage API keys.

***

## Rate limits

The API uses two-tier rate limiting. File submission endpoints have a stricter limit; all other endpoints share a higher general limit.

| Tier           | Endpoints                                                                                           | Limit            |
| -------------- | --------------------------------------------------------------------------------------------------- | ---------------- |
| **Submission** | `POST /v2/workflows/{id}/run/`, `POST /v2/workflows/{id}/upload/`, `POST /v2/workflows/{id}/files/` | 60 requests/min  |
| **General**    | All other authenticated endpoints                                                                   | 600 requests/min |

Each tier has an independent counter — extraction endpoints don't consume your general quota, and vice versa.

If you exceed a limit, the API responds with `429 Too Many Requests`. Wait for the number of seconds in the `Retry-After` header before retrying.

All successful responses include rate-limit headers for the tier that applies:

| Header                  | Description                          |
| ----------------------- | ------------------------------------ |
| `x-ratelimit-limit`     | Maximum requests allowed per window  |
| `x-ratelimit-remaining` | Requests remaining in current window |
| `x-ratelimit-reset`     | Seconds until the rate limit resets  |

<Note>
  The `Retry-After` header appears only in 429 responses, not in every response.
</Note>

***

## Endpoints at a glance

The API is organized around three resource groups.

### Workflows

| Method | Endpoint                     | Description                                                      |
| ------ | ---------------------------- | ---------------------------------------------------------------- |
| POST   | `/v2/workflows/`             | [Create a workflow](/api-reference/workflows/create)             |
| GET    | `/v2/workflows/`             | [List workflows](/api-reference/workflows/list)                  |
| GET    | `/v2/workflows/{id}/`        | [Get a workflow](/api-reference/workflows/get)                   |
| DELETE | `/v2/workflows/{id}/`        | [Delete a workflow](/api-reference/workflows/delete)             |
| POST   | `/v2/workflows/{id}/run/`    | [Run a workflow on a file](/api-reference/workflows/run)         |
| POST   | `/v2/workflows/{id}/upload/` | [Upload a file (no processing)](/api-reference/workflows/upload) |
| GET    | `/v2/workflows/{id}/runs/`   | [List workflow runs](/api-reference/workflows/runs)              |

### Files

| Method | Endpoint                                          | Description                                  |
| ------ | ------------------------------------------------- | -------------------------------------------- |
| POST   | `/v2/workflows/{workflow_id}/files/`              | [Upload a file](/api-reference/files/create) |
| GET    | `/v2/workflows/{workflow_id}/files/`              | [List files](/api-reference/files/list)      |
| DELETE | `/v2/files/{id}/`                                 | [Delete a file](/api-reference/files/delete) |
| GET    | `/v2/workflows/{workflow_id}/files/{id}/results/` | [Get results](/api-reference/files/results)  |

### Webhooks

| Method | Endpoint             | Description                                        |
| ------ | -------------------- | -------------------------------------------------- |
| POST   | `/v2/webhooks/`      | [Create a webhook](/api-reference/webhooks/create) |
| GET    | `/v2/webhooks/`      | [List webhooks](/api-reference/webhooks/list)      |
| DELETE | `/v2/webhooks/{id}/` | [Delete a webhook](/api-reference/webhooks/delete) |

See [Webhooks overview](/api-reference/webhooks/overview) for setup, signing, and delivery semantics.

***

## Response format

Successful responses are JSON. The detailed envelope (including `as_lists=true` for tabular shapes) is documented in [Response formats](/api-reference/response-formats).

Error responses follow a consistent structured shape:

```json theme={null}
{
  "error": "Brief, human-readable error description",
  "detail": "Detailed explanation of what went wrong",
  "error_code": "MACHINE_READABLE_ERROR_CODE",
  "retryable": false,
  "request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
```

See [Errors](/api-reference/errors) for the complete error code reference and retry patterns.

***

## SDKs

Official client libraries with a fluent builder over the typed-graph API:

* [TypeScript SDK](/api-reference/sdks/typescript) — `npm install @anyformat/sdk`
* [Python SDK](/api-reference/sdks/python) — `pip install anyformat`
* [SDKs overview](/api-reference/sdks/overview) — both client libraries and the Claude Code skill

***

## OpenAPI schema

The full OpenAPI specification is available at:

* **JSON**: [https://api.anyformat.ai/schema/?format=json](https://api.anyformat.ai/schema/?format=json)
* **Swagger UI**: [https://api.anyformat.ai/docs/](https://api.anyformat.ai/docs/)
