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

# API Limits & Rate Limiting

Datalab implements limits to ensure fair usage and maintain service quality. This guide covers file size limits, page limits, and rate limiting.

## File Size Limits

| File Type        | Maximum Size |
| ---------------- | ------------ |
| PDF Documents    | 200 MB       |
| Images           | 200 MB       |
| Office Documents | 200 MB       |

## Page Limits

| Limit                     | Value |
| ------------------------- | ----- |
| Maximum pages per request | 7,000 |

For documents exceeding these limits, use the `page_range` parameter to process in segments:

```python theme={null}
from datalab_sdk import DatalabClient, ConvertOptions

client = DatalabClient()

# Process a large document in segments
options = ConvertOptions(page_range="0-999")
result1 = client.convert("large_document.pdf", options=options)

options = ConvertOptions(page_range="1000-1999")
result2 = client.convert("large_document.pdf", options=options)
```

## Rate Limits

### Request Rate Limit

| Limit               | Value |
| ------------------- | ----- |
| Requests per minute | 200   |
| Concurrent requests | 400   |

When you exceed request rate limits, you'll receive a `429` response. The SDK handles retries automatically. For raw API calls, implement retry logic:

```python theme={null}
import time
import requests

def api_call_with_retry(url, headers, files, data, max_retries=3):
    for attempt in range(max_retries):
        response = requests.post(url, headers=headers, files=files, data=data)

        if response.status_code == 429:
            time.sleep(60)
            continue

        return response

    raise Exception("Max retries exceeded")
```

### Page Concurrency Limit

In addition to request rate limits, Datalab enforces a limit on the total number of pages being processed concurrently across all your requests.

| Limit                      | Value |
| -------------------------- | ----- |
| Concurrent pages in flight | 5,000 |

Most workloads will not hit this limit. It primarily affects high-volume workloads with longer-running requests — for example, large or complex documents processed in accurate mode with additional features enabled — or extremely high-volume workloads. Such sustained workloads would benefit from an enterprise agreement or a batch job that we orchestrate for you. Contact [support@datalab.to](mailto:support@datalab.to) to discuss your requirements.

This limit differs from request rate limits in two important ways:

1. **It is not time-bound.** It limits the number of pages actively being processed at any given moment, not the number of requests per minute.
2. **It is enforced during processing, not at submission.** You will not receive a `429` response when submitting a document. Instead, the result will return with `success` set to `false` and an error message:

```json theme={null}
{
  "success": false,
  "error": "Page rate limit exceeded. Your team has {current_pages} pages in flight and this request adds {page_count} more ({total} total, limit: 5,000). Please wait for some requests to complete before submitting more, or contact support@datalab.to for a higher limit."
}
```

<Warning>
  Because this limit is not enforced at submission time, you won't get an HTTP error when submitting. Always check the `success` field in your results. If you're polling for results, back off and wait for in-flight requests to complete before submitting more.
</Warning>

## Enterprise Limits

Custom limits are available for enterprise plans:

* Higher file size limits
* Increased rate limits
* Priority processing

See [pricing](https://www.datalab.to/pricing) for details, or contact support to discuss your requirements.

## Next Steps

<CardGroup cols={2}>
  <Card title="Batch Processing" icon="layer-group" href="/docs/recipes/conversion/batch-documents">
    Process multiple documents efficiently in batch.
  </Card>

  <Card title="Error Codes" icon="circle-exclamation" href="/platform/errors">
    Understand HTTP error codes and subscription errors.
  </Card>

  <Card title="Billing" icon="credit-card" href="/platform/billing">
    Learn about per-page pricing and usage monitoring.
  </Card>

  <Card title="Webhooks" icon="bell" href="/platform/webhooks">
    Receive notifications when processing completes instead of polling.
  </Card>
</CardGroup>
