Get billing subscription
curl --request GET \
--url https://api.runaether.dev/orgs/{orgID}/billing/subscription \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.runaether.dev/orgs/{orgID}/billing/subscription"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.runaether.dev/orgs/{orgID}/billing/subscription', 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.runaether.dev/orgs/{orgID}/billing/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.runaether.dev/orgs/{orgID}/billing/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.runaether.dev/orgs/{orgID}/billing/subscription")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/orgs/{orgID}/billing/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"actions": {
"buy_credit_pack": {
"state": "available",
"via": "stripe_checkout"
},
"buy_inference_topup": {
"state": "available",
"via": "stripe_checkout"
},
"change_plan": {
"state": "available",
"via": "stripe_checkout"
},
"manage_subscription": {
"state": "available",
"via": "stripe_checkout"
},
"subscribe": {
"state": "available",
"via": "stripe_checkout"
},
"view_billing_history": {
"state": "available",
"via": "stripe_checkout"
}
},
"active_billing_cycle_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billing_cycle_starts_at": "2023-11-07T05:31:56Z",
"cancels_at": "2023-11-07T05:31:56Z",
"credits_remaining": 123,
"managed_by": "none",
"monthly_credit_grant": 123,
"payment_state": "not_required",
"plan": {
"allowed_tiers": [
"starter"
],
"credits_per_seat": 123,
"kind": "personal",
"monthly_price_per_seat_usd": 123,
"seat_count": 123,
"seats": [
{
"email": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "<string>"
}
]
},
"settlement_mode": "prepaid",
"tier": "free",
"warm_slot_limit": 1,
"billing_cycle_ends_at": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"store_app_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "org_membership_required",
"error": "<string>"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Billing
Get billing subscription
Reads the org’s subscription: its tier and warm slot limit, payment state, the channel that manages it and when it cancels, its credits and billing cycle, its plan with the members who occupy its seats, and each billing action’s availability for the caller on the requesting surface.
Use this tool when you need to:
- Check the org’s tier, credits_remaining and payment_state, such as after a task start was refused with 402 credits_exhausted or billing_blocked
- Decide whether the caller can subscribe, change plan, manage the subscription, see billing history, or buy a credit pack or an inference top-up from this surface
- Read warm_slot_limit before assigning warm slots
Examples:
- GET /orgs//billing/subscription?surface=web
Hints:
- orgID is the org’s uuid; surface is required, web, ios or android (422 from the schema when missing or any other value); the actions are the ones available from that surface.
- Carries tier (free, starter, pro, max or team), warm_slot_limit, payment_state (not_required, checkout_pending, active, grace_period, past_due, unpaid, canceled or blocked), managed_by (none, stripe, app_store or play_store), cancels_at (null while it renews), credits_remaining, monthly_credit_grant, settlement_mode (prepaid or enterprise_invoice), current_period_start and current_period_end, active_billing_cycle_id, billing_cycle_starts_at and billing_cycle_ends_at, and plan with kind, allowed_tiers, seat_count and seats.
- actions holds subscribe, change_plan, manage_subscription, view_billing_history, buy_credit_pack and buy_inference_topup, each a union on state: available with via (stripe_checkout, stripe_portal, store_purchase or store_customer_center), or the reason it is not, such as managed_elsewhere, subscription_active, free_tier or payment_delinquent. A caller who is not an owner, admin or billing member reads every action as requires_org_admin.
- On ios and android, store_app_user_id is the caller’s store identity once their first store purchase intent minted it; the read never mints it.
- Use createBillingCheckoutSession or createBillingPortalSession instead to take an available action, getBillingCatalog for prices, and listBillingWarmSlots for the slots themselves.
- Any member of the org may read it, every role included, with a session or a platform API key; 404 for an org without billing, 403 org_membership_required for a non-member, 400 for an orgID that is not a uuid, and 403 agent_host_route_not_allowed for an agent host’s grant.
GET
/
orgs
/
{orgID}
/
billing
/
subscription
Get billing subscription
curl --request GET \
--url https://api.runaether.dev/orgs/{orgID}/billing/subscription \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.runaether.dev/orgs/{orgID}/billing/subscription"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.runaether.dev/orgs/{orgID}/billing/subscription', 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.runaether.dev/orgs/{orgID}/billing/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.runaether.dev/orgs/{orgID}/billing/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.runaether.dev/orgs/{orgID}/billing/subscription")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/orgs/{orgID}/billing/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"actions": {
"buy_credit_pack": {
"state": "available",
"via": "stripe_checkout"
},
"buy_inference_topup": {
"state": "available",
"via": "stripe_checkout"
},
"change_plan": {
"state": "available",
"via": "stripe_checkout"
},
"manage_subscription": {
"state": "available",
"via": "stripe_checkout"
},
"subscribe": {
"state": "available",
"via": "stripe_checkout"
},
"view_billing_history": {
"state": "available",
"via": "stripe_checkout"
}
},
"active_billing_cycle_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billing_cycle_starts_at": "2023-11-07T05:31:56Z",
"cancels_at": "2023-11-07T05:31:56Z",
"credits_remaining": 123,
"managed_by": "none",
"monthly_credit_grant": 123,
"payment_state": "not_required",
"plan": {
"allowed_tiers": [
"starter"
],
"credits_per_seat": 123,
"kind": "personal",
"monthly_price_per_seat_usd": 123,
"seat_count": 123,
"seats": [
{
"email": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "<string>"
}
]
},
"settlement_mode": "prepaid",
"tier": "free",
"warm_slot_limit": 1,
"billing_cycle_ends_at": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"store_app_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "org_membership_required",
"error": "<string>"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Query Parameters
Response
OK