Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.barndoor.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Model Pricing is where you tell Barndoor how much each model costs per million input and output tokens. Barndoor uses your prices to:
  • enforce spending budgets in LLM Controls
  • record per-request estimated_cost values on every audit event (input cost, output cost, total)
  • power per-team / per-user / per-model cost attribution in the Reporting area
Pricing lives in the Barndoor portal under LLM Configuration → Model Pricing.
Model Pricing tab listing showing Default / Custom / Manual badges with Add Pricing Rule and Import Defaults controls
Without matching prices, requests still succeed — the gateway just records a cost of $0 for those requests. Token-denominated budgets are unaffected; spending budgets and cost reports show zero. Set pricing for every model you care about attributing cost to.

Before You Begin

  • A Barndoor account with admin or superadmin privileges.
  • An LLM Gateway with at least one provider and one model already configured — see Using the LLM Gateway.

Quickstart: Import Default Prices

Barndoor ships a curated catalog of market-rate prices for the most-popular providers (OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, Azure OpenAI, and many more). The fastest way to get started is to import the ones you use.
1

Open LLM Configuration → Model Pricing

The tab shows your current price list (empty on a fresh org).
2

Click Import Defaults

A modal opens with one row per default model, grouped by provider. Use the search box or the per-provider checkbox to select what you want.
3

Select models and click Import

Models you’ve already priced are disabled with an Imported badge so you can’t import duplicates. The footer shows the live count of selected rows.
Import Defaults modal with provider sections expanded and rows selected
Imported rows are your own copies. When Barndoor’s default catalog updates (for example, when a provider raises a price), your imported rows are not automatically refreshed. Re-import or edit the affected rows manually to pick up new prices.

How Pricing Resolves

When a request flows through the gateway, Barndoor finds the right price by checking your rules in this order. The first match wins.
TierUse when
1. Provider-specificYou’ve negotiated a custom rate with one specific provider connection (for example one of your Azure deployments).
2. CatalogThe price applies to a whole vendor line — every OpenAI provider, every Bedrock provider, etc. — but you don’t want it to apply across vendors.
3. Organization-wideThe price applies wherever the model name matches, regardless of which provider serves it. The simplest and most common scope.
4. Platform defaultsBarndoor’s curated catalog of market-rate prices. Kicks in as a safety net even if you’ve never imported anything.
Stick to organization-wide rules for everyday pricing. Use catalog or provider-specific overrides only when you genuinely have a different price for the same model on different vendors or connections (negotiated discount, fine-tuned model variant, etc.). Fewer rules means fewer surprises.

Creating a Pricing Rule Manually

1

Click Add Pricing Rule

The Create dialog opens.
2

Model pattern

Either pick an enabled model from the dropdown (auto-populated from your Model Routes) or type a custom pattern. Patterns can be:
  • Exactgpt-4o-mini matches only that exact model.
  • Prefix wildcardgpt-4o* matches gpt-4o, gpt-4o-mini, gpt-4o-2024-08-06, and any other model whose name starts with gpt-4o.
Only trailing * is supported. Patterns like *-mini, gpt-*-mini, or regex are not.
3

Catalog (optional)

Restrict this rule to one vendor line (OpenAI, Bedrock, etc.). Leave blank for Any catalog.
4

Provider (optional)

Restrict this rule to a single configured provider connection. Use this for negotiated discounts or pricing that differs by deployment.
5

Input + output cost per million tokens

Two dollar amounts, both required. Use the same per-million-token prices the provider publishes on their pricing page.
6

Save

The new rule appears in the listing immediately.
Add Pricing Rule dialog with model pattern, catalog, provider, and input / output costs filled in
Avoid overlapping rules at the same scope. If both gpt-4o (exact) and gpt-4o* (wildcard) exist at the catalog level, you’ll get inconsistent results — write rules whose patterns are mutually exclusive, or use exact-model rules only.

Updating and Resetting Prices

Edit any row to change the costs. Changes take effect immediately on the next request through the gateway.
You cannot edit the model_pattern, Catalog, or Provider fields after a rule is created. To change those, delete the rule and create a new one.

The Default / Custom / Manual badges

Each row in the listing shows a badge under its model pattern that tells you how it relates to Barndoor’s default catalog:
BadgeMeaning
DefaultYour rule matches Barndoor’s curated default for that pattern and the prices match exactly.
CustomA default exists for that pattern, but you’ve edited the input or output cost.
ManualNo default exists for that pattern — you created the rule from scratch.

Reset to Default

When a row is Custom, a Reset to default action appears next to it (and inside the Edit dialog). Clicking it reverts your input and output costs back to whatever Barndoor’s current default catalog says — useful when you’ve adjusted a price for a one-off experiment and want to roll back.
Reset to default uses the current default catalog, not the one you imported from. If Barndoor has updated the default since your import, Reset will move you to the new value. Edit + Save your old number explicitly if you want to keep what you had.

Require Pricing for Model Mappings

The toggle at the top of the Model Pricing tab — Require pricing for model mappings — is a safety net for organizations that want every billable model to have a price set before it can be enabled in a route.
'Require pricing for model mappings' toggle at the top of the Model Pricing tab
When on:
  • The Models and Model Routes tabs in LLM Configuration show a No pricing badge next to any model that has no matching rule.
  • You can’t enable a route that points at an unpriced model — Barndoor blocks the save with a message explaining what’s missing.
When off (default): unpriced models can be served normally; they just record cost as $0. Turn this on if you want to guarantee that nobody silently introduces a route whose cost won’t show up in reports.

How Pricing Plugs into the Rest of the Platform

FeatureUses pricing?Notes
Token budgets (LLM Controls)NoCaps total tokens. Independent of pricing.
Spending budgets (LLM Controls)YesEach successful request debits (prompt_tokens × input_rate) + (completion_tokens × output_rate). Without matching pricing the spending counter stays at 0 for that model.
Per-request audit eventsYesestimated_cost, input_cost, and output_cost fields are populated on the audit event for every successful LLM request.
Reporting → LLM UsageYesAggregates the per-request estimated_cost recorded on audit events.
Cost is computed after a successful upstream response, using the actual prompt + completion token counts reported by the provider. Failed requests record no cost.

Troubleshooting

The models being called don’t have matching pricing rules in your org. Check Model Pricing for rows that cover those models (exact pattern, prefix wildcard, or one of the default rows imported into your org).Spending budgets only debit cost when a price matches — they don’t auto-fall-back to the platform default catalog. Importing the relevant defaults is the fastest fix.
Same root cause as above — no pricing rule matched. Either:
  • The model name in the request didn’t match any pattern (look for trailing-* wildcard mismatches).
  • The request resolved to a provider whose provider-specific pricing override has zero rates.
Audit events for unpriced requests omit the cost fields entirely rather than writing $0, so you’ll see them as missing in some report views.
Price changes are forward-looking. They affect any request that happens after the change takes effect; they don’t retroactively re-cost historical audit events. Spending budgets keep the running totals they already accumulated under the old price.If you need to true up a budget after a price correction, contact [email protected].
Refresh the Model Pricing tab — it occasionally serves cached UI data right after a save. Once the page reloads you should see the new row. Pricing changes apply to subsequent gateway requests immediately, so if the row is correct in the listing it’s already in effect.
See How Pricing Resolves for the four-tier lookup order. The most specific scope (provider-specific) beats less specific ones (catalog, org-wide, defaults).If you have two rules at the same scope tier that both match (e.g. an exact gpt-4o and a wildcard gpt-4o* both at the org-wide scope), behavior is not guaranteed — the gateway uses the first match it finds. Remove the duplicate or tighten one of the patterns so only one matches each model.

Frequently Asked Questions

No. Imported rows are independent copies you own. When Barndoor’s default catalog updates (we refresh it periodically as providers change their pricing), your existing imported rows are unchanged. To pick up new defaults, either:
  • Re-import affected rows from the Import Defaults modal (already-imported rows are skipped, but newly-added defaults will become available), or
  • Reset to default on a Custom row to snap to the current default, or
  • Edit manually with the new price.
Currently USD only. All input and output costs are entered and recorded in US dollars. Reporting also surfaces USD.
Not directly — pricing is keyed on model name + scope, not request type. The simplest workaround is to expose distinct model aliases in Model Routes (for example gpt-4o-realtime vs gpt-4o-batch) and price each one independently.
Multiply by 1,000. Barndoor stores costs as USD per million tokens; if your provider quotes $0.0025 per 1K input tokens, enter 2.50 as the input cost per million.
Yes, if you want embedding requests to show up in spending budgets and cost reports. Embedding requests consume tokens (input only), so set the input rate for them and leave the output rate at 0.
You can pick. The Import Defaults modal lets you select individual models or use the per-provider checkbox to select an entire vendor’s catalog. The footer shows the live count of selected rows.

Need Help?

Reach out to [email protected] with:
  • The model name (and provider) you’re trying to price.
  • The pattern + costs you’ve configured (a screenshot of the row helps).
  • The behavior you’re seeing — $0 cost in reports, budget not debiting, unpriced-model warning, etc.