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

# API Reference

> FlexOrch REST API — full endpoint reference.

## Base URL

```
https://api.flexorch.com/v1
```

## Authentication

All requests require either an API key or a JWT token:

```bash theme={null}
# API key
-H "X-API-KEY: dfx_your_key_here"

# JWT token
-H "Authorization: Bearer eyJ..."
```

## Response format

All responses follow the same envelope:

```json theme={null}
{
  "data": { ... }
}
```

Errors:

```json theme={null}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable message"
  }
}
```

## Common error codes

| Code                    | HTTP | Description                                                                            |
| ----------------------- | ---- | -------------------------------------------------------------------------------------- |
| `INVALID_API_KEY`       | 401  | Key not found or revoked                                                               |
| `TRIAL_EXPIRED`         | 402  | Trial period ended                                                                     |
| `QUOTA_EXCEEDED`        | 429  | Credit limit reached                                                                   |
| `RATE_LIMIT_EXCEEDED`   | 429  | RPM limit reached                                                                      |
| `PLAN_UPGRADE_REQUIRED` | 403  | Feature not available on your plan                                                     |
| `FILE_TOO_LARGE`        | 400  | File exceeds the 5 MB limit (flat across all plans)                                    |
| `UNSUPPORTED_FILE`      | 400  | File extension not supported                                                           |
| `EXTENSION_MISMATCH`    | 400  | File content doesn't match its extension, and the detected type isn't supported either |
| `ENCRYPTED_PDF`         | 400  | PDF is password-protected — remove the password and re-upload                          |
| `PDF_TOO_MANY_PAGES`    | 400  | PDF exceeds 300 pages                                                                  |
| `XLSX_TOO_MANY_ROWS`    | 400  | XLSX sheet exceeds 50,000 rows                                                         |

## Auto-generated reference

The full endpoint reference below is generated directly from the [OpenAPI spec](https://api.flexorch.com/openapi.json) and is always up to date.
