Class BedrockPriceList

java.lang.Object
ai.redouble.nucleo.providers.bedrock.BedrockPriceList

public final class BedrockPriceList extends Object
The AWS price list for Bedrock, read into the standard on-demand token rates of every model it prices, so a listed model carries what a call on it costs. AWS publishes the list as public JSON, one file per service and region and no credential to read it: AmazonBedrockFoundationModels prices the first-party vendors (Anthropic, Amazon, Cohere, OpenAI, AI21, Writer) and AmazonBedrock the Mantle models and Nova. A product of a file is one billing line: its provider and model are the names the control plane lists the model under, so a price matches a model on the names its quota matches on, or model is the raw id where AWS lists no name; its usagetype names the billing dimension and the variant it applies to; its on-demand term carries the rate per 1K tokens or 1M tokens.

A billing line is understood through the words of its usagetype, which AWS writes in two grammars: USE1-MP:USE1_<dimension>-Units, where the dimension is the whole middle, and USE1-<model>-<dimension>, where the model's own name precedes the dimension and the dimension starts at its kind word. The dimension's words are the kind (input, output, cache read, cache write), global for the rate of a global. profile, and a fixed vocabulary of structural words; mantle anywhere in the line marks the Mantle surface's rate. Any other word marks a variant the runtime does not buy, a tier (flex, priority, batch), a long-context rate, a cache write held an hour, latency-optimized inference, reserved capacity, a modality other than text, and the line prices nothing. A word this class does not know is a variant by that rule, never silently the standard rate. Two lines left for one kind at different rates (an old model whose versions share a name) price nothing and say so, rather than pick one.

Beside the standard rates, every line of a model that is priced per token is kept as it is written, the usagetype to the rate per million: the model's listed rates. No word of a line decides whether it is kept, so a variant this class prices nothing from, and a word AWS writes next month, are both there for whoever reads the catalog entry.

Since:
0.1 (2026-10-19)
Author:
Andrey Santrosyan
  • Method Details

    • forRegion

      public static BedrockPriceList forRegion(software.amazon.awssdk.regions.Region region)
      The region's list, held briefly: the three Bedrock surfaces of one discovery run read the same two files, and a list does not move mid-run. A failed read is not cached, so the next surface tries again.
    • pricesOf

      public BedrockPriceList.Pricing pricesOf(String wireId, String providerName, String modelName, boolean mantle)
      The prices of a listed id, or why it has none. The model is found by the provider and model names the control plane lists it under, by the model name alone where the list states no provider (Nova), else by its bare id where the list spells the raw id; the rows taken are the global profile's for a global. id and the regional ones for every other, which is what AWS bills a geography profile at, and the Mantle surface's rows for a Mantle id where the list prices the surface apart. The input rate is required; the others are carried where the list has them. The listed rates are every per-token line of the same model, of every profile and surface, whether or not it has a standard price.
      Parameters:
      wireId - the id as listed
      providerName - the provider's name as the control plane lists it, null when unknown
      modelName - the model's name as the control plane lists it, null when unknown
      mantle - whether the id is the Mantle surface's