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

# Rate Limits

> Understand Friendli Model APIs rate limits and usage tiers. Tiers are based on lifetime spend and increase automatically as your usage grows.

export const RateLimitTiersTable = () => {
  const [state, setState] = useState({
    status: "loading"
  });
  const load = useCallback(() => {
    setState({
      status: "loading"
    });
    fetch("https://friendli.ai/api/public/rate-limit-tiers").then(response => {
      if (!response.ok) {
        throw new Error(`HTTP ${response.status}`);
      }
      return response.json();
    }).then(data => setState({
      status: "ok",
      data
    })).catch(error => setState({
      status: "error",
      error
    }));
  }, []);
  useEffect(() => {
    load();
  }, [load]);
  const formatOutputTokenLength = num => {
    if (num >= 1_000_000) {
      return `${Math.round(num / 1_000_000)}M`;
    }
    if (num >= 1000) {
      return `${Math.round(num / 1000)}K`;
    }
    return num.toString();
  };
  const formatTierQualification = qualification => qualification === 0 ? "Signed up" : `Lifetime spend of $${qualification.toLocaleString()}+`;
  const formatTierRpm = (tier, rpm, rpmForFreeModel) => {
    if (tier === 0) {
      return "Adaptive Rate Limits*";
    }
    if (rpmForFreeModel != null) {
      return rpmForFreeModel.toLocaleString();
    }
    return rpm.toLocaleString();
  };
  if (state.status === "loading") {
    return <p className="text-sm text-zinc-500 dark:text-zinc-400">
				Loading rate limits…
			</p>;
  }
  if (state.status === "error") {
    return <div className="not-prose space-y-2">
				<p className="text-sm text-zinc-700 dark:text-zinc-300">
					Could not load rate limits.
				</p>{" "}
				<button type="button" onClick={load} className="font-medium text-primary text-sm hover:underline">
					Try again
				</button>
			</div>;
  }
  const tiers = state.data?.tiers ?? [];
  return <table>
			<thead>
				<tr>
					<th>Tiers</th>
					<th>Qualifications</th>
					<th>RPM (paid model)</th>
					<th>RPM (free model)</th>
					<th>Output Token Length</th>
				</tr>
			</thead>
			<tbody>
				{tiers.map(tier => <tr key={`tier-${tier.id}`}>
						<td>{`Tier ${tier.id}`}</td>
						<td>{formatTierQualification(tier.qualification)}</td>
						<td>{formatTierRpm(tier.id, tier.rpm, null)}</td>
						<td>{formatTierRpm(tier.id, tier.rpm, tier.rpmForFreeModel)}</td>
						<td>{formatOutputTokenLength(tier.outputTokenLength)}</td>
					</tr>)}
				<tr>
					<td>Tier 5</td>
					<td>
						Contact <a href="mailto:support@friendli.ai">support@friendli.ai</a>
					</td>
					<td>Custom</td>
					<td>Custom</td>
					<td>Custom</td>
				</tr>
			</tbody>
		</table>;
};

Friendli Model APIs apply rate limits based on your usage tier. Higher tiers unlock higher request rates and output length limits.

## Tier-Based API Rate Limits

Tiers are based on **lifetime spending and update automatically**. As your lifetime spend grows, your tier increases. You can move up instantly by purchasing additional credits.

<RateLimitTiersTable />

<Info>
  **Adaptive Rate Limits**: Rate limits are applied dynamically based on overall platform conditions.
</Info>

<Warning>
  'Output Token Length' is how much the model can write in response. It’s different from 'Context Length', which is the sum of the input and output tokens.
</Warning>
