Skip to main content

Overview

Not live yet. Credit charging for apps launches officially in October. This page is published early for partners who want to experiment with it.
Apps that cost money to run — a call recorder paying a transcription provider, an enrichment app paying per match — charge the workspace in credits. Everything an app bills for is declared in one billing block on your application config:
src/application-config.ts
  • recurring — removed, no longer charged. Declare prices instead.
  • operations — what you charge for as you use it, from a logic function.
  • description — one friendly line shown to buyers on your marketplace listing.
Operations land on the workspace credit meter and its Settings > Usage breakdown.

Recurring charges

Removed in favor of prices. The platform no longer raises recurring charges, and the build still warns about them. Declare billing.prices instead.

Prices

Price billing is being rolled out and is off by default: until it is enabled for a workspace, the build validates billing.prices but the workspace is not charged.
A price is charged in real currency instead of credits. It is billed as a line of the workspace’s own Twenty subscription, so the workspace keeps a single invoice. Prices are in US dollars only for now.
src/application-config.ts
A price follows the billing interval of the workspace: a workspace on a monthly Twenty plan pays the monthly amount, a workspace on a yearly plan pays 12 times the monthly amount once a year. Billing starts when the install completes and stops at uninstall, prorated to the days left in the billing period. A price per: 'WORKSPACE_MEMBER' follows the member count of the workspace. A price per: 'CONNECTED_ACCOUNT' follows the number of accounts connected to your app in the workspace. Accounts of all your app’s connection providers count together: with a Google and a Microsoft provider, a workspace with two Google accounts and one Microsoft account pays for three. The price is not billed while no account is connected, and a disconnected account stops being billed. A workspace on a trial is not charged before the trial ends. The charge is taken before the install or the new connected account goes through. If the workspace’s payment method is declined, the install fails or the account is not connected, the admin is asked to update the payment method, and the rest of the workspace is unaffected. A workspace keeps the prices it installed your app with, including after it upgrades. When a new version changes, adds or removes a price, only new installations get the new prices. Prices are not billed on a server without billing enabled, nor for an app synced from a local source with twenty app dev. The build rejects a missing, duplicated or invalid universalIdentifier, an empty label or description, an unknown type, billingPeriod or per, an amountCents that is not a positive integer or exceeds 8,333,333 (12 times that is the most Stripe accepts for one price), a currency other than USD, and a price per: 'CONNECTED_ACCOUNT' in an app that declares no connection provider.

Billable operations

An operation is what your app charges for as it works. Each entry names an operation you choose and the label shown to workspace admins in Settings > Usage and to you in your app’s monitoring Credits used chart. It can optionally map onto one of the platform’s billing categories.
src/application-config.ts
icon is optional: a Twenty icon name (e.g. IconUserSearch) shown next to the label in your app’s credits breakdown on its settings page. operationType is optional and defaults to APP_OPERATION, the dedicated category for app charges. Set it only when the spend really is one of the platform’s categories: AI_CHAT_TOKEN, AI_WORKFLOW_TOKEN, WORKFLOW_EXECUTION, CODE_EXECUTION, WEB_SEARCH, CALL_RECORDING, EMAIL_SEND, APP_OPERATION. It decides how the spend is metered and which counting unit applies (tokens, invocations, minutes) — it is not what admins read. The label is. CODE_EXECUTION is where the platform meters your functions’ own runs, so charges filed there are mixed with them; prefer the default. The build rejects an unknown operationType, an empty label, and an operation name that is also declared under the removed billing.recurring.

Charging

Charge against a declared operation by name:
creditsUsedMicro is the amount in micro-credits (1 USD = 1,000,000). quantity is how many units the charge covers, in the unit implied by the operation’s category — minutes for CALL_RECORDING, invocations for CODE_EXECUTION, and so on. Notes:
  • Declaring operations is what lets Usage split your app’s spend by what it charged for. An app that declares nothing is still reported, as a single slice under its display name.
  • Charging an operation your manifest does not declare is rejected. Add it to billing.operations and sync.
  • Several operations may share one operationType. Two enrichment operations both metered as APP_OPERATION still show as two labelled slices.
  • Without operation, the charge lands in APP_OPERATION, or in the category you name with operationType, optionally with a free-form resourceContext. The two forms are mutually exclusive: operation carries the label, operationType does not.
  • Charging never fails your function. A billing error is logged and swallowed, and the call no-ops outside the logic function runtime so local runs and tests do not crash.

Checking before you spend

A workspace can run out of credits. When that happens your function is refused before your code starts, and the platform’s own work stops too: runAgent returns an error instead of running, and the other AI entry points refuse outright. sendInboxMessage runs no model and adds no AI charge of its own, though the function calling it is refused like any other; a member’s reply is charged like any chat turn. Uninstall and disconnect hooks are the exception and always run, so an app can still be removed cleanly. An execution that does get through can still fail late, on a platform call it did not write, if the workspace runs out mid-run; ai.generate then resolves with success: false and the reason in error. Ask first:
When credits are unavailable a reason comes with it: no-credits, no-subscription, or workspace-suspended. no-credits also covers an All usage limit an admin set on your app under Settings → Billing → Limits: the workspace may still have credits, but your app may not spend them. Notes:
  • It answers whether your app may spend in this workspace, not how much it has left. Your app does not see the balance, the plan or its limits.
  • It fails open. If the check times out or the server is unreachable it reports credits available, so an infrastructure hiccup does not stop your app. Treat it as a hint worth honouring, not as an authorization decision.
  • It is a snapshot. Credits can run out between the check and the work — including because of your own charges, since every charge you make moves the same counter this reads.
  • The gate is not applied uniformly. Not every outbound email path is credit-gated, so a false here tells you your app should not spend right now rather than predicting exactly which calls will fail.

Telling people what it costs

Declaring charges tells the platform how to meter your app; it does not tell a buyer what they will pay. Set billing.description for that — one short, friendly line shown on your marketplace listing, before anyone installs.
src/application-config.ts
It is free text on purpose: real pricing has tiers, minimums and per-unit rates that a single number cannot express. Keep it to a line. An app that declares operations also asks the installing admin for consent: the install screen lists “Bill credits to your workspace”, and the app page shows “Bills credits”, with your description on hover.

Attribution

Spend is attributed to whoever triggered the run, so it shows up in Usage by User. Runs with nobody behind them (a webhook, a cron) have no triggering person — pass userWorkspaceId if your app knows who the spend belongs to. It must belong to the workspace the app is installed in, and it is ignored when the run does have a triggering user.
Where to get one: context.userWorkspaceId on a triggered run, or listConnections(), which returns the userWorkspaceId of each connection’s owner.