Billing & Usage

Browse GraphQL domains.

Queries

OperationDescription
accountUsageWarningsGet account usage warnings.
billingDetailsRead the name, email, phone, address and tax IDs that appear on the invoices of an account; returns empty details and customer_available false before the account has a billing customer.
budgetGet a budget and its usage for the current month.
budgetsList the budgets the caller may manage with their usage this month, for one project or narrowed to a member or API key.
conversationAnalyticsSummarize the conversation activity and model use in the projects of an account, optionally for one project or label; returns totals, configurable time buckets and recent conversations, with private titles limited to participants.
creditBalanceRead how many credits an account has left in its monthly and purchased pools, with its monthly allocation and top-up price; returns the balance.
creditPackagesList the credit packages an account can buy and their prices before starting a credit checkout; returns the whole catalogue as one page.
creditTransactionsList the credit grants, purchases, refunds and charges of an account, newest first unless sorted otherwise; returns one page of credit transactions.
creditUsageBreak the credit spend of an account down by day, project and model, optionally for one project; returns the series with token counts per model.
featureGateCheck whether a plan allows a feature before offering it, for the caller or for the owner of a project; returns allowed with the required tier, limit and current count, and a denied gate is a result, not an error.
invoicesList the issued invoices of an account, or with kind upcoming the previews and drafts of what it will be charged next; returns one page of invoices with amounts in minor currency units.
paymentMethodsList the cards saved for an account and which one is the default; returns one page of payment methods, which are changed in the billing portal.
paymentsList the payments an account has made, with their receipt links; returns one page of payments with amounts in minor currency units.
projectCollaborationGet available seats.
subscriptionRead the plan, billing cycle, seats and add-ons of an account before changing or cancelling its subscription; returns the subscription with its seat usage.
usageRead what an account has used of each plan quota in the current billing period, with its tier, project count, credits spent and warnings; returns usage where a total of -1 means unlimited.
usageSeriesChart one usage metric of an account by day, optionally for one project; returns the daily series with a total and a per-project breakdown.

Mutations

OperationDescription
cancelSubscriptionSchedule the paid subscription of an account to end with its current billing period; returns the canceled subscription.
createBillingPortalSessionOpen a Stripe billing portal session where a person changes payment methods, tax details or the renewal of an account; returns the portal URL.
createBudgetCreate a monthly AI spending limit for a project, a member on a project, an API key, or a combination of these.
createCreditCheckoutStart a Stripe checkout to buy a credit package for an account, or for the account that owns a project; returns the checkout URL.
deleteBudgetDelete budget.
redeemCreditCouponRedeem a coupon code for credits on an account; returns the credits granted and the new balance, or already_redeemed for a code the account used before.
updateBillingDetailsChange the name, email, phone or address on the invoices of an account, where an omitted field keeps its value and null clears it; returns the updated billing details.
updateBudgetChange the monthly limit of a budget, keeping its scope and this month’s usage.
updateSubscriptionChange the plan, billing cycle, seats or add-ons of an account; returns what changed, or a checkout URL when the change needs payment.