ReqLLM.PricingContext (ReqLLM v1.28.0)

View Source

Confirmed request and response facts used for local pricing.

OpenAI API facts come from the physical endpoint, not model defaults. Only known OpenAI hosts establish regional processing; other hosts leave that fact to independently confirmed caller context. The returned service tier replaces any caller preference. A missing or auto tier is unknown, never default.

Summary

Functions

Merges confirmed OpenAI endpoint and returned metadata into explicit context.

Functions

from_openai(url, provider_metadata, explicit_context \\ %{})

@spec from_openai(String.t() | URI.t() | nil, map() | nil, map() | keyword() | nil) ::
  map()

Merges confirmed OpenAI endpoint and returned metadata into explicit context.

Accepts a URL string or URI and atom- or string-keyed response metadata. Other explicit facts are preserved. No request preference is used as a billed tier.