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

# Rate limits

> Request and token rate limits for the abliteration.ai API. Your limits are set by your tier — the higher of your subscription plan and the spend tier you earn from lifetime usage.

Rate limits cap how many requests and tokens you can use in a given window. Your limits are set by your **tier**, and each limit applies separately to your organization, each project, and each API key.

The limits that currently apply to your organization, projects, and keys are shown on the [Limits page](https://abliteration.ai/console/limits) in the Console.

## How limits are measured

| Limit                     | Counts                              |
| ------------------------- | ----------------------------------- |
| Requests per minute (RPM) | requests started per minute         |
| Requests per day (RPD)    | requests started per day            |
| Tokens per minute (TPM)   | input + output tokens per minute    |
| Tokens per day (TPD)      | input + output tokens per day       |
| Concurrent requests       | requests in flight at the same time |

Every limit is enforced at three scopes — organization, project, and API key — and a request counts against all three.

## Tiers

Your tier is the higher of two things:

* your **subscription plan**, and
* the **spend tier** you earn from your total lifetime payments.

Whichever is higher applies, so paying more — by subscription or by usage — only ever raises your limits.

| Tier   | Lifetime paid | Subscription |
| ------ | ------------- | ------------ |
| Free   | —             | Free         |
| Tier 1 | \$20          | Developer    |
| Tier 2 | \$50          | Growth       |
| Tier 3 | \$200         | Scale        |
| Tier 4 | \$1,000       | —            |
| Tier 5 | \$5,000       | —            |

A subscription sets your tier immediately. Spend accumulates over time and graduates you automatically — a free account that has paid \$200 in usage reaches Tier 3 without a subscription.

## Limits by tier

Values below are **per API key**.

| Tier   | RPM | TPM | Requests/day | Tokens/day | Concurrent |
| ------ | --- | --- | ------------ | ---------- | ---------- |
| Free   | 60  | 1M  | 10,000       | 50M        | 4          |
| Tier 1 | 120 | 2M  | 15,000       | 150M       | 8          |
| Tier 2 | 300 | 4M  | 25,000       | 300M       | 12         |
| Tier 3 | 500 | 6M  | 50,000       | 600M       | 16         |
| Tier 4 | 700 | 8M  | 75,000       | 800M       | 32         |
| Tier 5 | 900 | 10M | 100,000      | 1B         | 32         |

Project limits are **1.5×** and organization limits are **2×** the per-key request and token values. Concurrent-request limits are set per scope:

| Tier     | API key | Project | Organization |
| -------- | ------- | ------- | ------------ |
| Free     | 4       | 6       | 8            |
| Tier 1   | 8       | 10      | 12           |
| Tier 2   | 12      | 14      | 16           |
| Tier 3   | 16      | 16      | 16           |
| Tier 4–5 | 32      | 32      | 32           |

## Rate limit headers

Every response reports your current usage. Header names match the OpenAI API.

| Header                                 | Meaning                                                           |
| -------------------------------------- | ----------------------------------------------------------------- |
| `x-ratelimit-limit-requests`           | request limit for the window                                      |
| `x-ratelimit-remaining-requests`       | requests remaining                                                |
| `x-ratelimit-reset-requests`           | time until the request window resets                              |
| `x-ratelimit-limit-tokens`             | token limit for the window                                        |
| `x-ratelimit-remaining-tokens`         | tokens remaining                                                  |
| `x-ratelimit-reset-tokens`             | time until the token window resets                                |
| `x-ratelimit-limit-project-tokens`     | project token limit, when a project token limit is the constraint |
| `x-ratelimit-remaining-project-tokens` | project-scoped tokens remaining                                   |
| `x-ratelimit-reset-project-tokens`     | time until the project token window resets                        |

Reset values are durations, like `42s`. The request and token headers report the scope — key, project, or organization — that is closest to its limit.

## When you hit a limit

A request over a limit returns `429 Too Many Requests` with a `Retry-After` header (seconds to wait). The error body follows the OpenAI format on `/v1/chat/completions` and `/v1/responses`, and the Anthropic format on `/v1/messages`.

<Accordion title="Error response body">
  <CodeGroup>
    ```json OpenAI theme={"system"}
    {
      "error": {
        "message": "Rate limit exceeded.",
        "type": "rate_limit_error",
        "param": null,
        "code": "rate_limit_exceeded"
      }
    }
    ```

    ```json Anthropic theme={"system"}
    {
      "type": "error",
      "error": {
        "type": "rate_limit_error",
        "message": "Rate limit exceeded."
      }
    }
    ```
  </CodeGroup>
</Accordion>

Honor `Retry-After` when it is present: wait at least that long, then add a small random delay so multiple clients do not retry at the same time. If it is absent, fall back to exponential backoff with jitter. Cap both the attempt count and the total retry time. Do not retry `401`, `402`, or `403`; those require you to fix the key, add credits, or change scope.

## Handle a 429

The official SDKs retry eligible `429`s automatically and honor `Retry-After`. For most workloads, raise the retry count instead of writing your own loop. Expand an example below.

<AccordionGroup>
  <Accordion title="OpenAI SDK">
    The OpenAI SDKs retry `429` and transient errors with exponential backoff (2 attempts by default). Raise `max_retries` for bursty traffic.

    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from openai import OpenAI

      client = OpenAI(
          base_url="https://api.abliteration.ai/v1",
          api_key=os.environ["ABLIT_KEY"],
          max_retries=5,
      )

      # Or override per request:
      resp = client.with_options(max_retries=5).chat.completions.create(
          model="abliterated-model",
          messages=[{"role": "user", "content": "Hello"}],
      )
      ```

      ```javascript Node theme={"system"}
      import OpenAI from "openai";

      const client = new OpenAI({
        baseURL: "https://api.abliteration.ai/v1",
        apiKey: process.env.ABLIT_KEY,
        maxRetries: 5,
      });
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Pydantic AI">
    Pydantic AI calls abliteration.ai through the OpenAI SDK, so it inherits the same retry and `Retry-After` handling. Configure it on the `AsyncOpenAI` client you pass to the provider.

    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from openai import AsyncOpenAI
      from pydantic_ai import Agent
      from pydantic_ai.models.openai import OpenAIChatModel
      from pydantic_ai.providers.openai import OpenAIProvider

      client = AsyncOpenAI(
          base_url="https://api.abliteration.ai/v1",
          api_key=os.environ["ABLIT_KEY"],
          max_retries=5,
      )
      model = OpenAIChatModel(
          "abliterated-model",
          provider=OpenAIProvider(openai_client=client),
      )
      agent = Agent(model)
      ```
    </CodeGroup>

    For per-status retries or custom backoff, pass a retrying `http_client`. See [OpenAI-compatible models](https://ai.pydantic.dev/models/openai/) in the Pydantic AI docs.
  </Accordion>

  <Accordion title="Anthropic SDK">
    On `/v1/messages`, the Anthropic SDKs retry `429` and honor `Retry-After` the same way.

    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from anthropic import Anthropic

      client = Anthropic(
          base_url="https://api.abliteration.ai",
          api_key=os.environ["ABLIT_KEY"],
          max_retries=5,
      )
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Custom backoff">
    To manage retries yourself, add exponential backoff with jitter. Each example sets `max_retries=0` so the SDK's own retries do not stack.

    <CodeGroup>
      ```python Tenacity theme={"system"}
      import os
      from openai import OpenAI, RateLimitError
      from tenacity import (
          retry,
          retry_if_exception_type,
          stop_after_attempt,
          wait_random_exponential,
      )

      client = OpenAI(
          base_url="https://api.abliteration.ai/v1",
          api_key=os.environ["ABLIT_KEY"],
          max_retries=0,
      )


      @retry(
          retry=retry_if_exception_type(RateLimitError),
          wait=wait_random_exponential(min=1, max=60),
          stop=stop_after_attempt(6),
      )
      def completion_with_backoff(**kwargs):
          return client.chat.completions.create(**kwargs)


      completion_with_backoff(
          model="abliterated-model",
          messages=[{"role": "user", "content": "Hello"}],
      )
      ```

      ```python backoff theme={"system"}
      import os
      import backoff
      from openai import OpenAI, RateLimitError

      client = OpenAI(
          base_url="https://api.abliteration.ai/v1",
          api_key=os.environ["ABLIT_KEY"],
          max_retries=0,
      )


      @backoff.on_exception(backoff.expo, RateLimitError)
      def completion_with_backoff(**kwargs):
          return client.chat.completions.create(**kwargs)


      completion_with_backoff(
          model="abliterated-model",
          messages=[{"role": "user", "content": "Hello"}],
      )
      ```

      ```python Manual theme={"system"}
      import os
      import random
      import time

      from openai import OpenAI, RateLimitError

      client = OpenAI(
          base_url="https://api.abliteration.ai/v1",
          api_key=os.environ["ABLIT_KEY"],
          max_retries=0,
      )


      def retry_with_exponential_backoff(
          func,
          initial_delay: float = 1,
          exponential_base: float = 2,
          jitter: bool = True,
          max_retries: int = 10,
          errors: tuple = (RateLimitError,),
      ):
          """Retry a function with exponential backoff."""

          def wrapper(*args, **kwargs):
              num_retries = 0
              delay = initial_delay
              while True:
                  try:
                      return func(*args, **kwargs)
                  except errors:
                      num_retries += 1
                      if num_retries > max_retries:
                          raise Exception(f"Maximum number of retries ({max_retries}) exceeded.")
                      delay *= exponential_base * (1 + jitter * random.random())
                      time.sleep(delay)
                  except Exception:
                      raise

          return wrapper


      @retry_with_exponential_backoff
      def completion_with_backoff(**kwargs):
          return client.chat.completions.create(**kwargs)
      ```
    </CodeGroup>

    Tenacity and backoff are third-party tools; abliteration.ai makes no guarantees about their reliability or security. The manual example is a starting point, not a complete solution; as written it honors neither `Retry-After` nor a total-time cap.
  </Accordion>
</AccordionGroup>

## Reduce rate-limit errors

* Read `x-ratelimit-remaining-requests` and `x-ratelimit-remaining-tokens` and slow down before you reach zero.
* Cap retry attempts and total retry time. Every attempt, including failed ones, counts against your limit.
* Raise your limits by subscribing or spending more; whichever tier is higher applies.

See [pricing](/pricing) for per-token rates and [plans](https://abliteration.ai/pricing) to subscribe or buy credits.
