Create billing plan
Create an AI billing plan; metered overage also provisions the catalog products needed for invoicing.
Authorizations
Body
Create plan payload
ID of the credit product every customer on the plan draws from. Credits plans only; null leaves each customer's policy to name its own. On replacement, omission preserves the current product and null clears it. Rejected while a customer on the plan draws from another product.
1"prd_credits"
Agents the plan lists, each with its own rate card or null for the plan's. Listing an agent does two things: it prices that agent's records with its card first (falling through to the plan's card row by row), and it routes that agent to this plan for every customer on it, ahead of an all-agents plan. So an agent listed only to give it a price on a plan with all_agents_enabled still counts as listed: attaching a customer who has another plan listing the same agent is rejected (plan_agent_conflict), and so is listing it here while such a customer is attached (agent_routing_conflict). At most one entry per agent. On replacement, omission keeps the current list and an empty list clears it.
200Whether the plan bills every agent of its customers, besides the agents it lists. When false, only the listed agents are billed through it, and an agent no plan of the customer covers is recorded and not billed. Defaults to true on creation; on replacement, omission keeps the current value. Turning it on, or listing an agent, is rejected while a customer on the plan already gets that agent through another plan.
true
Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
- refuse: Rejects the call that crosses the boundary without deducting usage.
- metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.
- usage_events: Accepts the call as overage and bills it as usage events (
event_type: ai_overage_usage, one per item with itsunits) priced by your catalog. overage_markup_percent and overage_rate_card_id must be null. Not available in wallet mode.
refuse, metered, usage_events "metered"
Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes and settlement_threshold_amount.
- calendar_month: Settles at the end of each UTC calendar month.
calendar_month "calendar_month"
Unsettled balance, in whole minor units, at which usage settles. Null means no amount override. Mutually exclusive with settlement_interval_minutes and settlement_schedule, and refused with overage_mode usage_events, whose overage is sent whatever its amount.
1 <= x <= 100000000null
Response
ID of the credit product every customer on the plan draws from. Credits plans only; null leaves each customer's policy to name its own. On replacement, omission preserves the current product and null clears it. Rejected while a customer on the plan draws from another product.
"prd_credits"
Agents the plan lists, each with its own rate card or null for the plan's. Listing an agent does two things: it prices that agent's records with its card first (falling through to the plan's card row by row), and it routes that agent to this plan for every customer on it, ahead of an all-agents plan. So an agent listed only to give it a price on a plan with all_agents_enabled still counts as listed: attaching a customer who has another plan listing the same agent is rejected (plan_agent_conflict), and so is listing it here while such a customer is attached (agent_routing_conflict). At most one entry per agent. On replacement, omission keeps the current list and an empty list clears it.
Whether the plan bills every agent of its customers, besides the agents it lists. When false, only the listed agents are billed through it, and an agent no plan of the customer covers is recorded and not billed. Defaults to true on creation; on replacement, omission keeps the current value. Turning it on, or listing an agent, is rejected while a customer on the plan already gets that agent through another plan.
true
Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
- refuse: Rejects the call that crosses the boundary without deducting usage.
- metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.
- usage_events: Accepts the call as overage and bills it as usage events (
event_type: ai_overage_usage, one per item with itsunits) priced by your catalog. overage_markup_percent and overage_rate_card_id must be null. Not available in wallet mode.
refuse, metered, usage_events "metered"
Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes and settlement_threshold_amount.
- calendar_month: Settles at the end of each UTC calendar month.
calendar_month "calendar_month"
Unsettled balance, in whole minor units, at which usage settles. Null means no amount override. Mutually exclusive with settlement_interval_minutes and settlement_schedule, and refused with overage_mode usage_events, whose overage is sent whatever its amount.
null

