> ## 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.

# Models and Pricing

> View Friendli Model APIs pricing per model. Compare token-based and audio-based rates across text and audio models.

export const ModelApisAudioMinuteBasedTable = () => {
  const [state, setState] = useState({
    status: "loading"
  });
  const load = useCallback(() => {
    setState({
      status: "loading"
    });
    fetch("https://friendli.ai/api/public/model-apis").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 formatAudioPrice = price => `$${price.audioMinutePrice} / ${price.unit}`;
  if (state.status === "loading") {
    return <p className="text-sm text-zinc-500 dark:text-zinc-400">
				Loading pricing…
			</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 pricing.
				</p>{" "}
				<button type="button" onClick={load} className="font-medium text-primary text-sm hover:underline">
					Try again
				</button>
			</div>;
  }
  const modelApis = state.data?.modelApis?.filter(modelApi => modelApi.price?.priceUnitType === "AUDIO_MINUTE") ?? [];
  if (modelApis.length === 0) {
    return <p className="text-sm text-zinc-500 dark:text-zinc-400">
				No model APIs in this category.
			</p>;
  }
  return <table>
			<thead>
				<tr>
					<th>Model ID</th>
					<th>Price per Audio Minute</th>
				</tr>
			</thead>
			<tbody>
				{modelApis.map(modelApi => <tr key={modelApi.id}>
						<td>
							<code>{modelApi.id}</code>
						</td>
						<td>{formatAudioPrice(modelApi.price)}</td>
					</tr>)}
			</tbody>
		</table>;
};

export const ModelApisTokenBasedTable = () => {
  const [state, setState] = useState({
    status: "loading"
  });
  const load = useCallback(() => {
    setState({
      status: "loading"
    });
    fetch("https://friendli.ai/api/public/model-apis").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 formatTokenPrice = price => {
    const hasCachedInputPrice = price.cachedInputPrice != null;
    const cachedSuffix = hasCachedInputPrice ? ` · Cached Input $${price.cachedInputPrice}` : "";
    if (price.inputPrice === price.outputPrice) {
      return `$${price.inputPrice}${cachedSuffix} / ${price.unit}`;
    }
    return `Input $${price.inputPrice}${cachedSuffix} · Output $${price.outputPrice} / ${price.unit}`;
  };
  if (state.status === "loading") {
    return <p className="text-sm text-zinc-500 dark:text-zinc-400">
				Loading pricing…
			</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 pricing.
				</p>{" "}
				<button type="button" onClick={load} className="font-medium text-primary text-sm hover:underline">
					Try again
				</button>
			</div>;
  }
  const modelApis = state.data?.modelApis?.filter(modelApi => modelApi.price?.priceUnitType === "TOKEN" && !modelApi.price?.isFree) ?? [];
  if (modelApis.length === 0) {
    return <p className="text-sm text-zinc-500 dark:text-zinc-400">
				No model APIs in this category.
			</p>;
  }
  return <table>
			<thead>
				<tr>
					<th>Model ID</th>
					<th>Price per Token</th>
				</tr>
			</thead>
			<tbody>
				{modelApis.map(modelApi => <tr key={modelApi.id}>
						<td>
							<code>{modelApi.id}</code>
						</td>
						<td>{formatTokenPrice(modelApi.price)}</td>
					</tr>)}
			</tbody>
		</table>;
};

Model APIs are often more economical, with access to a wide range of models. Pricing varies by model type—text models are charged by processed tokens of your request, while audio models are charged by the duration of processed audio.

## Text Models

Text models are charged by the **number of processed tokens**.

<ModelApisTokenBasedTable />

## Audio Models

Audio models are charged based on the **duration of processed audio**. Charges are calculated per second and aggregated into a per-minute rate for clarity.

<ModelApisAudioMinuteBasedTable />

<Note>
  For custom pricing, contact [support@friendli.ai](mailto:support@friendli.ai).
</Note>
