Billing
curl --request GET \
--url https://api.example.com/v1/billing/my-usageimport requests
url = "https://api.example.com/v1/billing/my-usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/billing/my-usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/billing/my-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/billing/my-usage"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/billing/my-usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/billing/my-usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyOverview
Billing
Read credits, usage, and billing settings
GET
/
v1
/
billing
/
my-usage
Billing
curl --request GET \
--url https://api.example.com/v1/billing/my-usageimport requests
url = "https://api.example.com/v1/billing/my-usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/billing/my-usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/billing/my-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/billing/my-usage"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/billing/my-usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/billing/my-usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyBilling endpoints use:
Billing endpoints are organization-admin surfaces 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.
Usage rows include:
BYOK model calls use customer-provided keys and are not charged as Platform inference.
https://billing.runtools.ai/v1
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
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 admin by default. Pass all=true to include per-member rows for the organization.
string
default:"current"
One of
current, 7d, 30d, or all_time.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' });
| 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 |
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 | Org admin | Verify a completed checkout session |
POST | /v1/billing/promo-codes/redeem | Org admin | Redeem a promo code for credits |
GET | /v1/billing/auto-topup | Org admin | Read auto-top-up settings |
PUT | /v1/billing/auto-topup | Org admin | Update 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
}'