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
| Method | Path | Description |
|---|
GET | /v1/billing/plan | Current plan and credit summary |
GET | /v1/billing/credits | Current credit balance |
GET | /v1/billing/credits/history | Credit ledger history |
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.
One of current, 7d, 30d, or all_time.
Admin-only: include all organization members and aggregate org totals.
curl "https://billing.runtools.ai/v1/billing/my-usage?period=30d" \
-H "X-API-Key: $RUNTOOLS_API_KEY"
const usage = await rt.billing.myUsage({ period: '30d' });
const allOrg = await rt.billing.myUsage({ all: true, period: 'current' });
Usage rows include:
| Field | Meaning |
|---|
tokens | Platform model input/output/total tokens |
modelUsage | Usage by model identifier, not by internal provider |
sandboxRuntime | Settled, pending, forgiven, and active sandbox runtime estimates |
storageUsage | Workspace storage byte-second summaries |
toolExecutions | Tool execution count |
resourceCharges | Other settled resource-level charges |
BYOK model calls use customer-provided keys and are not charged as Platform inference.
Top Up Credits
| Method | Path | Access | Description |
|---|
POST | /v1/billing/topup | Org admin | Create a Stripe Checkout session for credit top-up |
GET | /v1/billing/success | Authenticated | Verify a completed checkout session |
GET | /v1/billing/auto-topup | Authenticated | Read auto-top-up settings |
PUT | /v1/billing/auto-topup | Org admin | Update auto-top-up settings |
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 -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.