Skip to content

cayu.budgets.billing

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.budgets import BillingIdentity

Provider-neutral commercial identity and possible pricing contexts.

Providers own the meaning of their evidence. Core preserves it durably and enforces that completion cannot rewrite request evidence or widen the set of pricing outcomes established before dispatch.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
provider_name str required
resource_id str required
request_evidence Mapping[str, Any] Field(default_factory=dict)
completion_evidence Mapping[str, Any] Field(default_factory=dict)
pricing_contexts tuple[PricingContext, ...] ()
BillingIdentity.validate_identity_text(value: str, info) -> str
BillingIdentity.validate_evidence_input(value: Any, info) -> dict[str, Any]
BillingIdentity.freeze_evidence(value: Mapping[str, Any]) -> Mapping[str, Any]
BillingIdentity.serialize_evidence(value: Mapping[str, Any]) -> dict[str, Any]
BillingIdentity.validate_unique_pricing_contexts() -> BillingIdentity

Release source · Runtime guarantees · Capability guides

from cayu.budgets import BillingIdentityState
BillingIdentityState = Annotated[UnresolvedBillingIdentity | ResolvedBillingIdentity, Field(discriminator='status')]

Release source · Runtime guarantees · Capability guides

from cayu.budgets import PricingContext

One exact set of commercial dimensions that may price a dispatch.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
dimensions Mapping[str, str] required
PricingContext.validate_dimensions_input(value: Any) -> dict[str, str]
PricingContext.freeze_dimensions(value: Mapping[str, str]) -> Mapping[str, str]
PricingContext.serialize_dimensions(value: Mapping[str, str]) -> dict[str, str]
PricingContext.storage_key() -> tuple[tuple[str, str], ...]

Release source · Runtime guarantees · Capability guides

from cayu.budgets import ResolvedBillingIdentity

The provider hook ran; the dispatch may or may not have an identity.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
status Literal['resolved'] 'resolved'
identity BillingIdentity | None None
ResolvedBillingIdentity.validate_identity(value: BillingIdentity | None) -> BillingIdentity | None

Release source · Runtime guarantees · Capability guides

from cayu.budgets import UnresolvedBillingIdentity

The provider’s request hook has not resolved commercial identity yet.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
status Literal['unresolved'] 'unresolved'

Release source · Runtime guarantees · Capability guides