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

# Rate Limits

export const DynamicRPMList = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    let attempts = 0;
    const maxAttempts = 50;
    const formatAmount = num => {
      if (typeof num === "number") {
        return num.toLocaleString();
      }
      return num || "-";
    };
    const interval = setInterval(() => {
      const clientComponent = document.getElementById("dynamic-rpm-list");
      if (clientComponent && window.jiekouRemoteData.llmModels.status === 'loaded') {
        const modelList = window.jiekouRemoteData.llmModels.data.filter(model => {
          return Boolean(model.rpm);
        });
        const allModels = modelList.map(model => {
          const t1 = (model.quota_items || []).find(item => item.tier === "T1") || ({});
          const t2 = (model.quota_items || []).find(item => item.tier === "T2") || ({});
          const t3 = (model.quota_items || []).find(item => item.tier === "T3") || ({});
          const t4 = (model.quota_items || []).find(item => item.tier === "T4") || ({});
          const t5 = (model.quota_items || []).find(item => item.tier === "T5") || ({});
          return `
            <tr>
              <td rowspan="2" style="vertical-align: middle; max-width: 230px">${model.id}</td>
              <td>RPM</td>
              <td>${formatAmount(t1.rpm)}</td>
              <td>${formatAmount(t2.rpm)}</td>
              <td>${formatAmount(t3.rpm)}</td>
              <td>${formatAmount(t4.rpm)}</td>
              <td>${formatAmount(t5.rpm)}</td>
            </tr>
            <tr>
              <td>TPM</td>
              <td>${formatAmount(t1.tpm)}</td>
              <td>${formatAmount(t2.tpm)}</td>
              <td>${formatAmount(t3.tpm)}</td>
              <td>${formatAmount(t4.tpm)}</td>
              <td>${formatAmount(t5.tpm)}</td>
            </tr>
          `;
        }).join('');
        clientComponent.innerHTML = `
          <table class="table table-big">
            <thead>
              <tr>
                <th>模型</th>
                <th></th>
                <th>T1</th>
                <th>T2</th>
                <th>T3</th>
                <th>T4</th>
                <th>T5</th>
              </tr>
            </thead>
            <tbody>
              ${allModels}
            </tbody>
          </table>
        `;
        clearInterval(interval);
      }
      attempts++;
      if (attempts >= maxAttempts) {
        clearInterval(interval);
      }
    }, 200);
    return <div id="dynamic-rpm-list"></div>;
  }
};

## Understanding Rate Limits

Rate limits define the number of API requests that can be made within a specific period of time, helping optimize API usage.

* Prevent API abuse and misuse
* Ensure fair resource allocation
* Maintain API performance and reliability
* Protect service stability

## Default Rate Limits

Each account has default rate limits when calling models, measured in RPM (requests per model per minute) and TPM (tokens per model per minute). Rate limits vary by account tier. See the table below for the specific criteria.

<table class="table table-big">
  <thead>
    <tr>
      <th class="min-w-10">Quota Tier</th>
      <th>Eligibility (USD)</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>T1</td>
      <td>Highest total top-up amount in a single month over the last 3 calendar months \< \$50</td>
    </tr>

    <tr>
      <td>T2</td>
      <td>\$50 ≤ Highest total top-up amount in a single month over the last 3 calendar months \< \$500</td>
    </tr>

    <tr>
      <td>T3</td>
      <td>\$500 ≤ Highest total top-up amount in a single month over the last 3 calendar months \< \$3000</td>
    </tr>

    <tr>
      <td>T4</td>
      <td>\$3000 ≤ Highest total top-up amount in a single month over the last 3 calendar months \< \$10000</td>
    </tr>

    <tr>
      <td>T5</td>
      <td>\$10000 ≤ Highest total top-up amount in a single month over the last 3 calendar months</td>
    </tr>
  </tbody>
</table>

Default rate limits for each tier (RPM / TPM):

<DynamicRPMList />

## Avoiding Rate Limits

If the number of your API requests exceeds the rate limit, the API will return:

* HTTP status code: 429 (Too Many Requests).
* A message in the response body indicating that the rate limit has been exceeded.

To avoid triggering rate limits, you can take the following measures:

* Implement request throttling in your application.
* Use exponential backoff when retrying.
* Monitor your API usage.

## Handling 429 Errors

If you receive a 429 error, you can try the following:

* **Try again later**: Wait for a period of time before retrying your request.
* **Optimize requests**: Reduce the request frequency.
* **Increase rate limits**: If you need higher rate limits, please contact us.
