Skip to content

Control AI Gateway model access and pricing

Choose which models your applications can call through each Gateway provider, and track costs at your own rates. Each provider has a Models tab where you allow or block models, add fine-tuned or unlisted models, and, on a bring-your-own-key (BYOK) provider, override the price Gateway uses to calculate cost. Built-in providers support access settings only.

You do not need the Models tab to send requests: every model a provider serves is allowed until you change it. Access settings apply to every request routed through that provider, whichever API key or gateway endpoint the request uses. You need organization-admin access to change them.

Allow or block models

  1. Open AI Inference → Gateway → Providers, check the selected organization, click Edit on a provider, and open the Models tab. The list shows each model the provider serves, with its access and price.

    The Models tab for an OpenAI BYOK provider, searched for gpt-5.4, with Default model access set to Allow and gpt-5.4-mini selected

    Every model follows Default model access until you give it its own setting.

  2. Select a model. Under Model access, click Allow or Block. The change saves right away, and a message with Undo confirms it. The first option, for example Default (allow), removes the model’s own setting so it follows the default again. To change several models at once, click Select models.

Default model access applies to models without their own setting, including models the provider adds later. Allow, the default, permits every model you have not blocked. Block permits only the models you allow, which turns the list into an allow-list.

A blocked model’s Connect button is disabled. A request for a blocked model fails with 403 and the error code model_not_allowed. The message says which setting blocked it. When the model has its own Block setting:

Model `gpt-5.4-mini` is blocked for this provider. An organization admin can change this under Gateway → Providers → Models.

When Default model access is Block and the model has no setting of its own:

This provider only allows listed models, and `gpt-5.4-mini` isn't listed. An org admin can add it in Gateway → Providers → Models.

Add a fine-tuned or unlisted model

If the provider doesn’t list a model, such as your own fine-tuned model, add it by ID.

  1. On the Models tab, click Configure custom model. If you search for an ID that isn’t listed, you can click Configure next to it instead. Enter the Model ID exactly as your application sends it, for example ft:gpt-4.1-mini-2025-04-14:acme::support-v2.

  2. Choose Model access, or keep the default to follow Default model access. On a BYOK provider, turn on Set pricing to enter prices, as described in the next section. If you keep the default, set a price: a model with neither its own access setting nor a price has nothing to save.

  3. Click Save model. The model opens in the editor and appears in the list with a Custom model label.

    The Configure custom model dialog with a fine-tuned model ID, access set to Allow, and custom input and output prices

    A fine-tuned model with its own prices. Without a price, Gateway can’t calculate the model’s cost.

Set custom prices on a BYOK provider

Gateway calculates each request’s cost from its token counts and a price in USD per million tokens. By default it uses the catalog price from Gateway’s model catalog. That cost counts toward spending limits and policies. A custom price replaces the catalog price for one model on one provider. Use it when you pay a negotiated rate or when the catalog has no price for the model. It changes only the cost Gateway records; your provider still bills you directly.

  1. Select a model. The Pricing section shows its catalog price, if any.
  2. Turn on Custom price. If the model has a catalog price, the fields start with it; otherwise they start empty.
  3. Enter Input and Output prices. Cache read and Cache write price tokens served from or written to the provider’s prompt cache; they are optional, and empty values use the input price.
  4. Click Save prices. The model shows a Custom price badge in the list.

If the provider has Require pricing data turned on and the model has no catalog price, there is no switch: Input and Output prices are required, even for a blocked model.

Overriding the catalog price of gpt-5.4-mini with custom input, output, and cache read prices

A custom price on gpt-5.4-mini, replacing its catalog price.

If the provider answers with a dated version of the model you requested, such as gpt-5.4-mini answered as gpt-5.4-mini-2026-03-17, a custom price on gpt-5.4-mini also applies. If both names have a custom price, the dated name’s price applies. On a Bedrock provider whose base URL is Bedrock Mantle (https://bedrock-mantle.<region>.api.aws), a custom price on an anthropic. model also applies when the response drops that prefix, such as anthropic.claude-opus-4-7 answered as claude-opus-4-7. For any other name in the response, Gateway uses the custom price of the model in the response, or its catalog price if it has none.

To return to the catalog price, turn Custom price off and click Save prices. Built-in providers always use the catalog price.

Requests for a model with no price

Gateway refuses a request before it reaches the provider when it needs a price for the model and has none.

ProviderWhenStatus
Built-inThe catalog has no price for the model404
BYOK with Require pricing data turned onThe model has no catalog price and no custom price400

A built-in provider answers:

No cost data available for model `my-model`. If you expected this to work, please let us know on Slack: https://pydantic.dev/docs/logfire/join-slack/

A BYOK provider answers:

Cost estimates are currently required but there is no cost data available for `my-model`. Disable required cost estimates to use this model.

Built-in providers are billed through Logfire, so Gateway never forwards a built-in request that it can’t price. A BYOK provider forwards an unpriced request when Require pricing data is off, and Gateway records no cost for it.

Verify it worked

Open Playground from the sidebar, choose the provider and model, and send a short message. The Playground needs a project API key; if it shows project key required, click Create project key first.

  • An allowed model answers. A blocked model still appears in the model list, but the request returns the 403 error above.
  • For a custom price, check the cost shown under the reply. It should match your price, not the catalog price.

Custom prices in traces

When you call Gateway from your code, the cost Gateway calculates, including your custom price, is recorded as operation.cost on the model request span. This needs one of:

If a response has no cost from Gateway, the Logfire SDK’s OpenAI and Anthropic integrations record an estimate from catalog prices instead, which doesn’t include your custom price, and the Google GenAI integration records no cost.

Troubleshooting

  • A model is rejected unexpectedly: check the model’s own setting, then Default model access. With the default set to Block, every model you have not allowed is rejected, including newly released ones.
  • A blocked model still works: check which provider handled the request. Settings are per provider, so an endpoint can still reach the model through another provider.
  • No pricing data error: on a BYOK provider, Require pricing data is turned on in its Settings tab and the model has no price. Set a custom price, or turn that setting off. On a built-in provider, the catalog has no price for the model, so check the model ID. See Requests for a model with no price.
  • Batch or file requests fail with 403: on a BYOK provider that blocks any model, Gateway rejects requests whose model it can’t read, such as requests it passes through without parsing.
  • A custom price is ignored: check which model the response reports. The Playground shows it under each reply. If it is not the model you requested or a dated version of it, set the price on the reported model ID.
  • Costs look wrong: prices are per million tokens. Check whether cache prices are set; empty ones use the input price.

To cap what the allowed models can spend, set spending limits.