Sign Up

Billing

Get the automatic top-up

GET
/orgs/{org_id}/billing/automatic-top-up

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The automatic top-up

application/json
  1. response
currency*string

The lowercase ISO 4217 currency code.

enabled*boolean

Whether automatic top-up is enabled.

target_cents?|

The balance targeted by a top-up, in cents, or null when unset.

Formatint64
threshold_cents?|

The balance that triggers a top-up, in cents, or null when unset.

Formatint64
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/automatic-top-up'
{  "currency": "string",  "enabled": true,  "target_cents": 0,  "threshold_cents": 0}
DELETE
/orgs/{org_id}/billing/automatic-top-up

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

Automatic top-up reset

curl -X DELETE 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/automatic-top-up'
Empty

Set the automatic top-up

PUT
/orgs/{org_id}/billing/automatic-top-up

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
target_cents*integer

The balance targeted by a top-up, in cents.

Formatint64
Rangevalue <= 99999999
threshold_cents*integer

The balance that triggers a top-up, in cents.

Formatint64
Range1000 <= value <= 99998999

Response Body

The automatic top-up, updated

application/json
  1. response
currency*string

The lowercase ISO 4217 currency code.

enabled*boolean

Whether automatic top-up is enabled.

target_cents?|

The balance targeted by a top-up, in cents, or null when unset.

Formatint64
threshold_cents?|

The balance that triggers a top-up, in cents, or null when unset.

Formatint64
curl -X PUT 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/automatic-top-up' \  -H 'Content-Type: application/json' \  -d '{  "target_cents": 99999999,  "threshold_cents": 1000}'
{  "currency": "string",  "enabled": true,  "target_cents": 0,  "threshold_cents": 0}
GET
/orgs/{org_id}/billing/balance-notification

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The balance notification

application/json
  1. response
currency*string

The lowercase ISO 4217 currency code.

enabled*boolean

Whether low-balance notifications are enabled.

threshold_cents?|

The notification threshold in cents, or null when unset.

Formatint64
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/balance-notification'
{  "currency": "string",  "enabled": true,  "threshold_cents": 0}
DELETE
/orgs/{org_id}/billing/balance-notification

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

Balance notification reset

curl -X DELETE 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/balance-notification'
Empty
PUT
/orgs/{org_id}/billing/balance-notification

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
threshold_cents*integer

The notification threshold in cents.

Formatint64
Range500 <= value <= 5000000

Response Body

The balance notification, updated

application/json
  1. response
currency*string

The lowercase ISO 4217 currency code.

enabled*boolean

Whether low-balance notifications are enabled.

threshold_cents?|

The notification threshold in cents, or null when unset.

Formatint64
curl -X PUT 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/balance-notification' \  -H 'Content-Type: application/json' \  -d '{  "threshold_cents": 500}'
{  "currency": "string",  "enabled": true,  "threshold_cents": 0}

List billing balances

GET
/orgs/{org_id}/billing/balances

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of balances

application/json
  1. response
balances*array<>

The balances in this page.

next_cursor?|

The next page cursor, or null at the end.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/balances'
{  "balances": [    {      "applicable_to": null,      "balance_cents": 0,      "created_at": "2019-08-24T14:15:22Z",      "currency": "string",      "expires_at": "2019-08-24T14:15:22Z",      "granted_amount_cents": 0,      "id": "string",      "name": "string",      "type": "credit"    }  ],  "next_cursor": "string"}

List billing charges

GET
/orgs/{org_id}/billing/charges

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of charges

application/json
  1. response
charges*array<>

The charges in this page.

next_cursor?|

The next page cursor, or null at the end.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/charges'
{  "charges": [    {      "amount_cents": 0,      "created_at": "2019-08-24T14:15:22Z",      "currency": "string",      "description": "string",      "failure_message": "string",      "has_invoice": true,      "has_pdf": true,      "id": "string",      "invoice_url": "string",      "receipt_url": "string",      "status": "succeeded"    }  ],  "next_cursor": "string"}

Get a charge receipt PDF

GET
/orgs/{org_id}/billing/charges/{charge_id}/pdf

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid
charge_id*string

The charge ID

Response Body

The charge receipt PDF

response?ChargeReceiptPdfapplication/pdf

The charge receipt PDF.

Formatbinary
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/charges/string/pdf'
"string"

Get the billing contact

GET
/orgs/{org_id}/billing/contact

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The billing contact

application/json
  1. response
effective_email?|

The email currently used for billing notices, or null when unavailable.

email?|

The configured billing email, or null when unset.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/contact'
{  "effective_email": "string",  "email": "string"}

Set the billing contact

PUT
/orgs/{org_id}/billing/contact

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
email?|

The billing email to set, or null to restore the default.

Response Body

The billing contact, updated

application/json
  1. response
effective_email?|

The email currently used for billing notices, or null when unavailable.

email?|

The configured billing email, or null when unset.

curl -X PUT 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/contact' \  -H 'Content-Type: application/json' \  -d '{}'
{  "effective_email": "string",  "email": "string"}

Redeem a billing coupon

POST
/orgs/{org_id}/billing/coupons/redeem

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
code*string

The coupon code.

Match^[A-Za-z0-9_-]{1,64}$

Response Body

The created coupon redemption

application/json
  1. response
code*string

The redeemed coupon code.

credit_cents*integer

The granted credit in cents.

Formatint64
credit_expires_at?|

When the granted credit expires, or null when it does not expire.

Formatdate-time
currency*string

The lowercase ISO 4217 currency code.

redeemed_at*string

When the coupon was redeemed.

Formatdate-time
curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/coupons/redeem' \  -H 'Content-Type: application/json' \  -d '{  "code": "string"}'
{  "code": "string",  "credit_cents": 0,  "credit_expires_at": "2019-08-24T14:15:22Z",  "currency": "string",  "redeemed_at": "2019-08-24T14:15:22Z"}

List billing invoices

GET
/orgs/{org_id}/billing/invoices

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

unpaid?boolean

Whether to return only unpaid invoices (default false)

Response Body

The page of invoices

application/json
  1. response
invoices*array<>

The invoices in this page.

next_cursor?|

The next page cursor, or null at the end.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/invoices'
{  "invoices": [    {      "currency": "string",      "file_url": "string",      "has_pdf": true,      "id": "string",      "issued_at": "2019-08-24T14:15:22Z",      "number": "string",      "payment_due_at": "2019-08-24T14:15:22Z",      "payment_overdue": true,      "payment_status": "pending",      "status": "draft",      "subtotal_amount_cents": 0,      "suspends_at": "2019-08-24T14:15:22Z",      "taxes_amount_cents": 0,      "total_amount_cents": 0,      "total_due_amount_cents": 0,      "type": "usage"    }  ],  "next_cursor": "string"}
POST
/orgs/{org_id}/billing/invoices/{invoice_id}/payment-sessions

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid
invoice_id*string

The invoice ID

Response Body

The created billing session

application/json
  1. response
expires_at?|

When the session expires, or null when the provider does not expose an expiry.

Formatdate-time
url*string

The generated session URL.

curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/invoices/string/payment-sessions'
{  "expires_at": "2019-08-24T14:15:22Z",  "url": "string"}

Get an invoice PDF

GET
/orgs/{org_id}/billing/invoices/{invoice_id}/pdf

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid
invoice_id*string

The invoice ID

Response Body

The invoice PDF

response?InvoicePdfapplication/pdf

The invoice PDF.

Formatbinary
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/invoices/string/pdf'
"string"
POST
/orgs/{org_id}/billing/payment-method-sessions

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The created billing session

application/json
  1. response
expires_at?|

When the session expires, or null when the provider does not expose an expiry.

Formatdate-time
url*string

The generated session URL.

curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/payment-method-sessions'
{  "expires_at": "2019-08-24T14:15:22Z",  "url": "string"}
GET
/orgs/{org_id}/billing/payment-methods

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of payment methods

application/json
  1. response
next_cursor?|

The next page cursor, or null at the end.

payment_methods*array<>

The payment methods in this page.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/payment-methods'
{  "next_cursor": "string",  "payment_methods": [    {      "brand": "amex",      "exp_month": 0,      "exp_year": 0,      "id": "string",      "is_default": true,      "last4": "string"    }  ]}

Get the billing plan

GET
/orgs/{org_id}/billing/plan

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The billing plan

application/json
  1. response
currency*string

The lowercase ISO 4217 currency code.

current_period?|

The current billing period, or null when unavailable.

entitlements*array<string>

The entitlement keys included in the plan.

fee_cents*integer

The recurring plan fee in cents.

Formatint64
limits*

The plan limits.

monthly_credit_cents*integer

The monthly included credit in cents.

Formatint64
pending?|

The scheduled plan change, or null when none is pending.

plan*PlanName

The scheduled plan.

Value in"starter""team""enterprise"
self_serve*boolean

Whether members can change this plan through the API.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/plan'
{  "currency": "string",  "current_period": null,  "entitlements": [    "string"  ],  "fee_cents": 0,  "limits": {    "max_concurrent_gpu_sandboxes": 0,    "max_concurrent_sandboxes": 0,    "max_members": 0,    "max_sandbox_memory_mib": 0,    "max_sandbox_vcpus": 0  },  "monthly_credit_cents": 0,  "pending": null,  "plan": "starter",  "self_serve": true}

Set the billing plan

PUT
/orgs/{org_id}/billing/plan

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
plan*PlanName

The requested plan.

Value in"starter""team""enterprise"

Response Body

The billing plan, updated

application/json
  1. response
currency*string

The lowercase ISO 4217 currency code.

current_period?|

The current billing period, or null when unavailable.

entitlements*array<string>

The entitlement keys included in the plan.

fee_cents*integer

The recurring plan fee in cents.

Formatint64
limits*

The plan limits.

monthly_credit_cents*integer

The monthly included credit in cents.

Formatint64
pending?|

The scheduled plan change, or null when none is pending.

plan*PlanName

The scheduled plan.

Value in"starter""team""enterprise"
self_serve*boolean

Whether members can change this plan through the API.

curl -X PUT 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/plan' \  -H 'Content-Type: application/json' \  -d '{  "plan": "starter"}'
{  "currency": "string",  "current_period": null,  "entitlements": [    "string"  ],  "fee_cents": 0,  "limits": {    "max_concurrent_gpu_sandboxes": 0,    "max_concurrent_sandboxes": 0,    "max_members": 0,    "max_sandbox_memory_mib": 0,    "max_sandbox_vcpus": 0  },  "monthly_credit_cents": 0,  "pending": null,  "plan": "starter",  "self_serve": true}

List billing plans

GET
/orgs/{org_id}/billing/plans

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The billing plans

application/json
  1. response
plans*array<>

The billing plan catalog.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/plans'
{  "plans": [    {      "currency": "string",      "entitlements": [        "string"      ],      "fee_cents": 0,      "limits": {        "max_concurrent_gpu_sandboxes": 0,        "max_concurrent_sandboxes": 0,        "max_members": 0,        "max_sandbox_memory_mib": 0,        "max_sandbox_vcpus": 0      },      "monthly_credit_cents": 0,      "plan": "starter",      "self_serve": true    }  ]}
POST
/orgs/{org_id}/billing/portal-sessions

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The created billing session

application/json
  1. response
expires_at?|

When the session expires, or null when the provider does not expose an expiry.

Formatdate-time
url*string

The generated session URL.

curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/portal-sessions'
{  "expires_at": "2019-08-24T14:15:22Z",  "url": "string"}

Get the billing profile

GET
/orgs/{org_id}/billing/profile

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The billing profile

application/json
  1. response
address*

The billing address.

email*string

The billing contact email.

name*string

The legal billing name.

phone*string

The billing contact phone number.

tax_ids*array<>

The registered tax identifiers.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/profile'
{  "address": {    "city": "string",    "country": "string",    "line1": "string",    "line2": "string",    "postal_code": "string",    "state": "string"  },  "email": "string",  "name": "string",  "phone": "string",  "tax_ids": [    {      "type": "ad_nrt",      "value": "string"    }  ]}

Create a top-up session

POST
/orgs/{org_id}/billing/top-up-sessions

Authorization

user_jwt write:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
amount_cents*integer

The amount to add in cents.

Formatint64
Range1000 <= value <= 99999999

Response Body

The created billing session

application/json
  1. response
expires_at?|

When the session expires, or null when the provider does not expose an expiry.

Formatdate-time
url*string

The generated session URL.

curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/top-up-sessions' \  -H 'Content-Type: application/json' \  -d '{  "amount_cents": 1000}'
{  "expires_at": "2019-08-24T14:15:22Z",  "url": "string"}
GET
/orgs/{org_id}/billing/usage-periods

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of usage periods

application/json
  1. response
next_cursor?|

The next page cursor, or null at the end.

usage_periods*array<>

The usage periods in this page, newest first.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/usage-periods'
{  "next_cursor": "string",  "usage_periods": [    {      "amount_cents": 0,      "charges": [        {          "billable_metric": "string",          "events_count": 0,          "name": "string",          "quantity": 0.1,          "total_cents": 0,          "units": "string"        }      ],      "currency": "string",      "end_at": "2019-08-24T14:15:22Z",      "issued_at": "2019-08-24T14:15:22Z",      "start_at": "2019-08-24T14:15:22Z",      "status": "open",      "taxes_amount_cents": 0,      "total_amount_cents": 0    }  ]}

Get the billing wallet

GET
/orgs/{org_id}/billing/wallet

Authorization

user_jwt read:billing
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:billing

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The wallet

application/json
  1. response
automatic_top_up*

The automatic top-up setting, including its unset state.

balance_cents*integer

The total available balance in cents.

Formatint64
billing_type*BillingType

The organization's billing arrangement.

Value in"pre-paid""post-paid"
currency*string

The lowercase ISO 4217 currency code.

free_credits_balance_cents*integer

The promotional-credit balance in cents.

Formatint64
paid_credits_balance_cents*integer

The purchased-credit balance in cents.

Formatint64
total_amount_due_this_month_cents*integer

The amount due in the current month, in cents.

Formatint64
total_spent_this_month_cents*integer

The amount spent in the current month, in cents.

Formatint64
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/wallet'
{  "automatic_top_up": {    "currency": "string",    "enabled": true,    "target_cents": 0,    "threshold_cents": 0  },  "balance_cents": 0,  "billing_type": "pre-paid",  "currency": "string",  "free_credits_balance_cents": 0,  "paid_credits_balance_cents": 0,  "total_amount_due_this_month_cents": 0,  "total_spent_this_month_cents": 0}