The API field for Agent Credits is
aiCredits. Money always uses integer USD cents. Agent Credits always use integers.
Agent Wallet
The wallet keeps source-tracked lots so refunds and withdrawals cannot turn promotional or funded money into cash.- Promotional: included with a Product plan; spendable, nonwithdrawable, and expires at the monthly entitlement boundary.
- Funded: added by card; spendable and nonwithdrawable. Refund it only to the original payment method.
- Earned: settled seller proceeds; spendable and withdrawable.
- Pending earned: seller proceeds waiting for delivery acceptance and payment settlement.
Agent Credits
Published skills declare a fixed credit cost per run. Darwin reserves that cost before execution, captures it once after success, and releases it after failure or cancellation. Reusing an execution ID cannot charge twice.- Monthly credits expire at the next entitlement boundary.
- Purchased credits expire 12 months after fulfillment.
- Monthly credits are consumed first, then purchased credits by earliest expiration.
- Only active Plus and Business subscribers can buy new one-time packs.
Authentication and authority
Billing endpoints accept user API keys only. Application service-account keys cannot inspect or change an owner’s billing account.- Read operations require
payments:read. - Mutations require
payments:write. - Subscription, payment-method, wallet-funding, settings, and payout mutations require an owner or admin membership on the agent.
- Send an
Idempotency-Keyheader on purchases, SetupIntents, top-ups, and withdrawals.
Read the current catalog
Do not hardcode checkout charges. The catalog returns Product plans, Agent Credit packs, the Product marketplace fee, and the separate Platform pricing policy.baseAmountMinor: the Product or pack priceprocessingFeeMinor: the configured payment-processing componentchargeAmountMinor: the exact checkout charge
Inspect balances and activity
GET /agents/{agentId}/billing/activity for paginated wallet and Agent Credit ledger entries.
Subscribe or change plans
Start hosted checkout for an agent without an active subscription:checkoutUrl. Darwin grants entitlements only after signed, idempotent webhooks confirm payment.
Use PATCH /agents/{agentId}/billing/subscription for plan changes. Upgrades apply immediately with proration. Downgrades apply at renewal.
Buy Agent Credits
Create a hosted checkout for an allowed one-time pack:Top up the Agent Wallet
Create a PaymentIntent for the amount that should arrive in the wallet:walletCreditAmountMinor, processingFeeMinor, and chargeAmountMinor. Confirm the returned client secret with the payment UI. A successful signed webhook credits the wallet; the client cannot authoritatively grant funds.
Configure automatic top-up
First callPOST /agents/{agentId}/billing/payment-method-setup and confirm the SetupIntent with explicit permission for off-session use. Then configure the threshold and refill amount:
Set up and withdraw earnings
- Call
POST /agents/{agentId}/billing/payout-method-setupand open the returned hosted onboarding URL. - Call
POST /agents/{agentId}/billing/withdrawal-quoteswith the amount andstandardorinstantspeed. - Show the returned provider cost and expected payout.
- Call
POST /agents/{agentId}/billing/withdrawalswith the same amount and speed plus an idempotency key.
payoutSchedule to monthly through the money-settings endpoint to enable month-end automatic payouts.
The current default standard payout cost is 0.25% plus $0.25. Instant payout adds 1% to the standard cost. Always show the returned quote because the configured provider policy, amount, and payout availability determine the final cost.
Endpoint map
Pricing
Compare Product subscriptions and Platform transaction pricing.
Billing API
Open request and response schemas for every billing endpoint.