Skip to content

Billing

Agents can read the account’s plan and billing status, and can ask their human to upgrade. Agents cannot pay, cancel, or change payment methods — only a human can, in the console, through a secure checkout.

  1. Don’t retry in a loop. A 403 plan_required or a 429 quota_exceeded will not clear by retrying.
  2. Call GET /v1/billing to see the current plan and any request already pending.
  3. Call POST /v1/billing/upgrade-requests to create an upgrade request. Pass the feature or metric from the error so your human sees what was blocked.
  4. Give the returned approval_url to your human.
  5. Poll GET /v1/billing/upgrade-requests/{id} at most once a minute until status is no longer pending.
  6. After status: completed, retry the original call about 15 seconds later.

See Error Codes for the error bodies that carry upgrade_url.

GET /v1/billing

Returns a read-only billing summary for the organization, including any pending upgrade request.

Terminal window
curl https://api.chronary.ai/v1/billing \
-H "Authorization: Bearer chr_sk_your_key_here"
{
"plan": "free",
"plan_source": null,
"plan_expires_at": null,
"status": null,
"interval": null,
"current_period_end": null,
"cancel_at": null,
"cancel_at_period_end": false,
"renews_at": null,
"price": null,
"has_billing_account": false,
"self_serve_upgrade": true,
"upgrade_options": [
{ "plan": "pro", "interval": "month", "amount": 2900, "currency": "usd", "savings_vs_monthly": 0 },
{ "plan": "pro", "interval": "year", "amount": 29000, "currency": "usd", "savings_vs_monthly": 5800 }
],
"upgrade_url": "https://console.chronary.ai/settings/billing",
"manage_url": "https://console.chronary.ai/settings/billing",
"contact_url": null,
"pending_upgrade_request": null,
"offer": null,
"past_due": null,
"credit": null
}

All amounts are in minor units (2900 = $29.00). Prices exclude tax; past_due.amount_due is the amount actually owed, tax included.

FieldDescription
planCurrent plan, for example free, developer, pro, or scale
plan_sourceHow the plan was granted, or null
plan_expires_atISO-8601 end of a time-limited plan grant, or null
statusSubscription status; null if the account never subscribed
intervalmonth or year, or null
current_period_endISO-8601 end of the current paid period, or null
cancel_atISO-8601 time a scheduled cancellation takes effect, or null
cancel_at_period_endtrue when a cancellation is scheduled
renews_atISO-8601 next renewal, or null when no renewal is expected
price{ amount, currency, interval, tax_exclusive } for the active subscription, or null
has_billing_accounttrue once the account has a billing profile (invoices and payment methods live in the console)
self_serve_upgradetrue when a human can start a secure checkout right now. Always false on Sandbox (free-agent-unverified), which can upgrade once it moves to Free
upgrade_optionsPlans a human can upgrade to; empty when self_serve_upgrade is false
upgrade_urlConsole link for a human to upgrade, or null
manage_urlConsole billing page
contact_urlContact link for plans that need a conversation (Scale), or null
pending_upgrade_requestThe pending upgrade request, or null
offerThe founding member offer for early-access accounts, or null
past_dueWhile status is past_due, the failed payment: { amount_due, currency, failed_at, next_payment_attempt, hosted_invoice_url, attempt_count }. amount_due includes tax, next_payment_attempt is null when no automatic retries are left, and hosted_invoice_url is where your human can pay. Otherwise null
creditAccount credit, { amount, currency }: for example the unused part of a yearly period after a switch to monthly billing. While the subscription renews, it is applied automatically to the next invoices. null when there is none

Developer plan fields

When the Developer plan is available, upgrade_options also lists it: a Free account is offered Developer ($4/month or $40/year) and Pro, and a Developer account is offered Pro, which takes effect immediately and is prorated. Prices exclude tax.

A move from Pro down to Developer takes effect at the end of the paid period. While it is scheduled, plan stays pro and two more fields are set:

FieldDescription
pending_planThe plan the account switches to at the end of the period (developer), or null
pending_plan_atISO-8601 time the switch takes effect, or null

A founding member who chose Developer keeps Pro for the whole free period: plan is pro, pending_plan is developer, pending_plan_at is the end of the free period, and price is the Developer price billing starts on. Your human can switch between Pro and Developer in the console while the free period runs, at no charge.

Accounts that joined during early access become founding members at launch: Pro stays free for at least 60 days after launch, and they can subscribe before then at a discount. If they subscribe with at least two days of the free period left, billing doesn’t start until it ends, at 12:00 UTC on the day the window ends; in the last two days, billing starts at checkout. The discount is for Pro only. A founding member can choose Developer instead: with at least two days of the free period left, they keep free Pro until it ends, then Developer bills at its regular price, with no founding discount.

{
"kind": "founding",
"status": "available",
"ends_at": "2027-02-01T00:00:00.000Z",
"trial_until": "2027-02-01T12:00:00.000Z",
"discount_percent": 50,
"discount_months": 12,
"renewal_consent": null
}
FieldDescription
kindAlways founding
statusupcoming — early-access account before launch; the offer opens at launch, and checkout and upgrade requests return 409 founding_offer_pending until then. available — free Pro until ends_at; subscribe before then (the offer is withdrawn 35 minutes before ends_at, when a founding checkout can no longer complete). redeemed — the subscription was created on founding terms
ends_atavailable: when free Pro and the offer end. Otherwise null
trial_untilavailable: billing starts at this time if your human subscribes now (null in the last two days, when billing starts at checkout). redeemed: the end of the free period while it lasts
discount_percentDiscount on the founding terms, or null when none applies. During a founding free period heading to Developer, the discount your human gets back by switching back to Pro before it ends (Developer itself has none); upgrade_options then lists Pro with via: "switch_plan"
discount_monthsThe minimum number of paid months the discount covers (monthly plans: checkout shows the date it runs until; annual plans: the first year), or null
renewal_consentredeemed only. required while a free period with a Washington DC billing address waits for your human to choose Continue to paid Pro (or Continue to paid Developer) on the console Billing page. If they don’t, the subscription ends when the free period does, with no charge. given once they have. Otherwise null. Agents can’t give this consent; hand manage_url to your human

When status is available and the account is about to need Pro features, give manage_url to your human — subscribing early costs nothing.

POST /v1/billing/upgrade-requests

Asks your human to upgrade the account to Pro. Returns an approval_url to give to your human. Honors the Idempotency-Key header. If a request is already pending, the same request comes back with reused: true and status 200 — don’t call again, poll it.

Requires an Organization key.

FieldTypeRequiredDescription
intervalstringNomonth (default) or year
reasonstring (max 500)NoWhy the upgrade is needed. Shown to your human as plain text
featurestringNoThe plan-gated feature that was blocked, for example scoped_keys
metricstringNoThe quota metric that was exhausted, for example api_calls
Terminal window
curl -X POST https://api.chronary.ai/v1/billing/upgrade-requests \
-H "Authorization: Bearer chr_sk_your_key_here" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"interval": "month", "reason": "Need scoped keys for my sub-agents", "feature": "scoped_keys"}'

200 OK with reused: true when a request is already pending.

{
"id": "upr_abc123",
"status": "pending",
"plan": "pro",
"interval": "month",
"reason": "Need scoped keys for my sub-agents",
"feature": "scoped_keys",
"metric": null,
"requested_via": "api",
"requested_by_key_prefix": "chr_sk_abcdefghijkl",
"approval_url": "https://console.chronary.ai/settings/billing/requests/upr_abc123",
"created_at": "2026-10-19T00:00:00.000Z",
"expires_at": "2026-10-26T00:00:00.000Z",
"completed_at": null,
"declined_at": null,
"canceled_at": null,
"owner_notification": "queued",
"reused": false
}
StatustypeMeaning
400validation_errorInvalid body (for example interval not month or year, or reason over 500 characters)
403forbiddenAgent key; use an Organization key
403use_billing_pageCalled from a console session; use the billing page instead
403email_verification_requiredThe account’s email isn’t verified yet
409already_subscribedThe account already has an active subscription
409payment_processingA first payment for Pro is still processing. Don’t ask your human to pay again; Pro activates when it clears
409unsupported_planThe current plan can’t self-serve upgrade; the error includes contact_url
409founding_offer_pendingEarly-access account before launch — Pro is still free, and the founding member offer opens at launch. Don’t ask your human to pay yet
409upgrade_request_recently_declinedA human recently declined; wait retry_after seconds before asking again
429upgrade_request_limitToo many requests; wait retry_after seconds
503billing_not_configuredBilling isn’t available in this environment
GET /v1/billing/upgrade-requests/{id}

Poll at most once a minute. When status leaves pending, stop polling.

Terminal window
curl https://api.chronary.ai/v1/billing/upgrade-requests/upr_abc123 \
-H "Authorization: Bearer chr_sk_your_key_here"

Returns the upgrade request object, or 404 not_found.

POST /v1/billing/upgrade-requests/{id}/cancel

Withdraws a pending request; its approval_url stops working. Returns the request with status: "canceled". Fails with 409 upgrade_request_not_pending (including the current status) if the request already completed, was declined, canceled, or expired.

await client.billing.upgradeRequests.cancel('upr_abc123');
FieldDescription
idUpgrade request ID (upr_ prefix)
statuspending, completed, declined, canceled, or expired
planThe plan requested (pro)
intervalmonth or year
reasonThe free text you supplied, or null. Always render as escaped plain text
feature / metricWhat was blocked, or null
requested_viaapi or mcp
requested_by_key_prefixFirst 20 characters of the key that made the request — never the full key
approval_urlLink to give your human; null once the request is no longer pending
created_at / expires_atISO-8601 timestamps
completed_at / declined_at / canceled_atISO-8601 timestamps, or null
owner_notificationCreate responses only: queued, not_configured, skipped_internal, already_notified, or muted (the owner turned upgrade-request emails off)
reusedCreate responses only: true when an already-pending request was returned

The same operations are available as MCP tools for Organization keys: get_billing, request_upgrade, get_upgrade_request, and cancel_upgrade_request. See the MCP Tools Reference.