Get billing checkout session
curl --request GET \
--url https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{lookup} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{lookup}"
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/checkout-sessions/{lookup}', 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/checkout-sessions/{lookup}",
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/checkout-sessions/{lookup}"
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/checkout-sessions/{lookup}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{lookup}")
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{
"checkout_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkout_session_token": "<string>",
"checkout_type": "subscription",
"status": "created",
"subscription_status": "active",
"target_tier": "starter",
"claimed_store_purchase": true,
"store_app_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_product_id": "<string>",
"url": "<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": "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>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Billing
Get billing checkout session
Reads one of the org’s checkout sessions, by its id or its public pcs_ token, with its purchase’s progress.
Use this tool when you need to:
- Poll a Stripe checkout or a store purchase intent until its subscription is active or its credits or top-up are granted
- Look up the checkout a return URL’s checkout_session_id or checkout_session_token names
Examples:
- GET /orgs//billing/checkout-sessions/6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21
- GET /orgs//billing/checkout-sessions/pcs_6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21
Hints:
- orgID is the org’s uuid; lookup is the session’s checkout_session_id, a lowercase uuid, or its checkout_session_token, pcs_ then a lowercase uuid (422 from the schema otherwise).
- A union on checkout_type: subscription carries target_tier and subscription_status (pending, pending_webhook, active or failed); credit_pack carries credit_pack_id, credits, amount_usd and purchase_status; inference_topup carries amount_usd, fee_usd and purchase_status (pending, pending_grant, granted or failed). status is created, completed, expired or failed.
- A Stripe checkout carries the url Stripe made for it; a store purchase intent carries its creator’s store_app_user_id, unless the creator’s account was deleted.
- Use createBillingCheckoutSession instead to open a checkout, and getBillingSubscription to read the subscription once subscription_status is active.
- Any member of the org may read it, every role included, with a session or a platform API key; 404 for a session the org does not hold, 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
/
checkout-sessions
/
{lookup}
Get billing checkout session
curl --request GET \
--url https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{lookup} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{lookup}"
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/checkout-sessions/{lookup}', 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/checkout-sessions/{lookup}",
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/checkout-sessions/{lookup}"
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/checkout-sessions/{lookup}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{lookup}")
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{
"checkout_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkout_session_token": "<string>",
"checkout_type": "subscription",
"status": "created",
"subscription_status": "active",
"target_tier": "starter",
"claimed_store_purchase": true,
"store_app_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_product_id": "<string>",
"url": "<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": "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>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Path Parameters
Response
OK
- Option 1
- Option 2
- Option 3