Skip to main content
GET
/
v1
/
billing
/
my-usage
Billing
curl --request GET \
  --url https://api.example.com/v1/billing/my-usage

Documentation Index

Fetch the complete documentation index at: https://docs.runtools.ai/llms.txt

Use this file to discover all available pages before exploring further.

Billing endpoints use the billing service:
https://billing.runtools.ai/v1
All endpoints require normal user or API-key authentication unless noted otherwise. Usage is returned at the customer-facing resource level: model tokens, sandbox runtime, storage, tool executions, and credit balance. Platform-internal provider routing is not exposed.

Plan And Credits

MethodPathDescription
GET/v1/billing/planCurrent plan and credit summary
GET/v1/billing/creditsCurrent credit balance
GET/v1/billing/credits/historyCredit ledger history
cURL
curl https://billing.runtools.ai/v1/billing/plan \
  -H "X-API-Key: $RUNTOOLS_API_KEY"

Usage

GET /v1/billing/my-usage returns usage for the authenticated member. Org admins can pass all=true to include per-member rows.
period
string
default:"current"
One of current, 7d, 30d, or all_time.
all
boolean
Admin-only: include all organization members and aggregate org totals.
cURL
curl "https://billing.runtools.ai/v1/billing/my-usage?period=30d" \
  -H "X-API-Key: $RUNTOOLS_API_KEY"
SDK
const usage = await rt.billing.myUsage({ period: '30d' });
const allOrg = await rt.billing.myUsage({ all: true, period: 'current' });
Usage rows include:
FieldMeaning
tokensPlatform model input/output/total tokens
modelUsageUsage by model identifier, not by internal provider
sandboxRuntimeSettled, pending, forgiven, and active sandbox runtime estimates
storageUsageWorkspace storage byte-second summaries
toolExecutionsTool execution count
resourceChargesOther settled resource-level charges
BYOK model calls use customer-provided keys and are not charged as Platform inference.

Top Up Credits

MethodPathAccessDescription
POST/v1/billing/topupOrg adminCreate a Stripe Checkout session for credit top-up
GET/v1/billing/successAuthenticatedVerify a completed checkout session
GET/v1/billing/auto-topupAuthenticatedRead auto-top-up settings
PUT/v1/billing/auto-topupOrg adminUpdate auto-top-up settings
cURL
curl -X POST https://billing.runtools.ai/v1/billing/topup \
  -H "X-API-Key: $RUNTOOLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amountCents":2500}'
cURL
curl -X PUT https://billing.runtools.ai/v1/billing/auto-topup \
  -H "X-API-Key: $RUNTOOLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "thresholdCents": 1000,
    "topupAmountCents": 2500
  }'

Internal Settlement

Credit checks, deductions, pricing reads, model settlement, sandbox-runtime quotes, storage quota, and storage usage billing are service-to-service endpoints. They are intentionally not part of the public SDK flow; the platform services call them after sandbox runtime, storage, model, code-exec, or tool usage is measured.