Version
READ

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.

The token behind the MCP session must hold it, or the call is refused with TOKEN_MISSING_ABILITY.

The REST endpoint and this tool share one action, so validation, permissions and events are identical.

Annotations

Read-only

It reads and never changes anything.

Arguments

plan_id*string

UUID of the plan the batch would be attached to.

quantity*integer

How 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_FOUND

unknown plan_id, or the plan belongs to a team outside the token's scope.

VALIDATION_FAILED

quantity is outside the 1..10,000 range.

AUTHENTICATION_REQUIRED

no authenticated user on the request.

TOKEN_MISSING_ABILITY

token lacks project-access-code:create.

How is this guide?

Last updated on