Skip to main content
GET
List the organization's model pricing rules

Authorizations

Authorization
string
header
required

A Barndoor API key, sent as Authorization: Bearer <key>. Keys are prefixed bdai_ and are opaque — do not attempt to decode one. Interchangeable with an OAuth 2.0 access token.

Response

The requested record

effective_from
string<date-time>
required
id
string<uuid>
required
input_cost_per_million_tokens
number<double>
required
model_pattern
string
required
org_id
string<uuid>
required
output_cost_per_million_tokens
number<double>
required
change_source
enum<string>
required

How a model_pricing version was produced. Persisted as a VARCHAR(20) constrained to one of these eight values (see migrations V34 + V35). Surfaced to admins as the "source" badge on each entry of the PricingHistoryDialog.

Available options:
admin_create,
admin_edit,
admin_schedule,
import,
sync_manual,
sync_auto,
admin_archive,
admin_restore
is_archived
boolean
required

True for tombstone rows produced by archive_rule (V35). When the latest effective version of a group has is_archived = true, the rule is considered archived: the cost calculator skips it and the admin summary list hides it by default. Past non-archived versions remain in the timeline so the History dialog can show the rule's full life including the archive event.

sync_mode
enum<string>
required

Per-row sync behavior. Stored as a VARCHAR(16) constrained to tracking | pinned | auto (see migration V33).

Available options:
tracking,
pinned,
auto
scheduled_count
integer<int64>
required

Versions of this rule with effective_from > now() that haven't activated yet. 0 means no scheduled change pending.

version_count
integer<int64>
required

Total versions in this rule's history (including current).

cache_read_cost_per_million_tokens
number<double> | null

Per-million-token cost for input tokens served from the prompt cache. None ⇒ the calculator bills cached input at input_cost_per_million_tokens.

cache_write_cost_per_million_tokens
number<double> | null

Per-million-token cost for input tokens added to the prompt cache. None ⇒ same fallback as cache_read_cost_per_million_tokens.

catalog_slug
string | null

Catalog slug for provider-level pricing (e.g. "openai", "aws_bedrock").

long_context
object | null

Optional context-tiered surcharge (BCP-3904). None ⇒ one rate set at every prompt size, i.e. exactly the pre-BCP-3904 behaviour.

Serialized as long_context, not as the Rust field name. This struct reaches the admin API through AdminModelPricing's #[serde(flatten)], so the field name here is the wire key — and every sibling surface (DefaultPricingEntry, EffectivePricing, the create/update request bodies) already spells it long_context. Left unrenamed, the pricing tab would write a tier successfully and then read back nothing, which is precisely how it behaved before this attribute existed: the surcharge saved, the dialog reopened unchecked, and the edit looked silently discarded. Pinned by admin_model_pricing_serializes_the_tier_as_long_context.

model_provider
string | null
provider_id
string<uuid> | null

Optional reference to a specific LLM Gateway provider instance.

provider_name
string | null
change_reason
string | null
created_by_email
string | null
created_by_name
string | null
created_by_user_id
string<uuid> | null
next_scheduled_effective_from
string<date-time> | null

When the next scheduled version takes effect, if any.