preview_access_code_cost
Preview the cost of generating access codes before queuing the batch. Returns free_remaining, chargeable_quantity, and cost.
Preview the cost of generating access codes before queuing the batch. Returns free_remaining, chargeable_quantity, and the resulting cost in the creator-tier currency so the agent can surface the charge to a human. Always call this first when quantity might exceed the creator tier free allotment — the generation tool refuses to run with chargeable codes unless the caller acknowledges overage.
Requires ability
The token behind the MCP session must hold it, or the call is refused with TOKEN_MISSING_ABILITY.
Runs the same action as
The REST endpoint and this tool share one action, so validation, permissions and events are identical.
Annotations
It reads and never changes anything.
Arguments
plan_id*stringUUID of the plan the batch would be attached to.
quantity*integerHow many access codes the agent is considering generating (1-10000).
What it returns
{ "data": { "plan_id": "c4e82f16-93a7-4d5b-b81c-6e0f27a94d3b", "quantity": 50, "preview": { "free_remaining": 3, "chargeable_quantity": 47, "cost": "1.41" }, "will_bill_overage": true }}How it fails
RESOURCE_NOT_FOUNDunknown plan_id, or the plan belongs to a team outside the token's scope.
VALIDATION_FAILEDquantity is outside the 1..10,000 range.
AUTHENTICATION_REQUIREDno authenticated user on the request.
TOKEN_MISSING_ABILITYtoken lacks project-access-code:create.
How is this guide?
Last updated on