Get billing
curl --request GET \
--url https://api.zode.dev/v1/billing \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zode.dev/v1/billing"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zode.dev/v1/billing', 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.zode.dev/v1/billing",
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.zode.dev/v1/billing"
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.zode.dev/v1/billing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/billing")
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{
"plan": {
"name": "free",
"monthly_fee_micros": 123,
"included_usage_micros": 123,
"signup_credit_micros": 123,
"max_concurrent": 123,
"recorder_days": 123
},
"limits": {
"name": "free",
"monthly_fee_micros": 123,
"included_usage_micros": 123,
"signup_credit_micros": 123,
"max_concurrent": 123,
"recorder_days": 123
},
"trial": {
"days": 123,
"available": true,
"active": true,
"plan": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"source": "self"
},
"period": {
"start": "2023-12-25",
"end": "2023-12-25",
"as_of": "2023-11-07T05:31:56Z"
},
"usage": {
"compute_micros": 123,
"storage_micros": 123,
"static_ip_micros": 123,
"billable_micros": 123,
"ai_micros": 123,
"ai_billed": true,
"ai_known": true
},
"estimate": {
"lines": [
{
"description": "<string>",
"kind": "<string>",
"micros": 123,
"cents": 123
}
],
"informational": [
{
"description": "<string>",
"kind": "<string>",
"micros": 123,
"cents": 123
}
],
"total_micros": 123,
"total_cents": 123
},
"credit": {
"balance_micros": 123,
"auto_top_up": {
"enabled": true,
"threshold_micros": 123,
"amount_micros": 123
}
},
"caps": {
"daily_micros": 123,
"sandbox_default_micros": 123,
"today_micros": 123
},
"billing_email": "<string>",
"provider": {
"configured": true,
"name": "<string>",
"plans": [
"<string>"
],
"offers": [
{
"name": "<string>",
"monthly_fee_micros": 123,
"included_usage_micros": 123,
"signup_credit_micros": 123,
"max_concurrent": 123,
"recorder_days": 123
}
]
},
"can_manage": true
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Usage and billing
Get billing
Plan, this month’s usage and invoice estimate, credit, caps, billing email (owner, admin, billing).
GET
/
v1
/
billing
Get billing
curl --request GET \
--url https://api.zode.dev/v1/billing \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zode.dev/v1/billing"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zode.dev/v1/billing', 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.zode.dev/v1/billing",
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.zode.dev/v1/billing"
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.zode.dev/v1/billing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/billing")
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{
"plan": {
"name": "free",
"monthly_fee_micros": 123,
"included_usage_micros": 123,
"signup_credit_micros": 123,
"max_concurrent": 123,
"recorder_days": 123
},
"limits": {
"name": "free",
"monthly_fee_micros": 123,
"included_usage_micros": 123,
"signup_credit_micros": 123,
"max_concurrent": 123,
"recorder_days": 123
},
"trial": {
"days": 123,
"available": true,
"active": true,
"plan": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"source": "self"
},
"period": {
"start": "2023-12-25",
"end": "2023-12-25",
"as_of": "2023-11-07T05:31:56Z"
},
"usage": {
"compute_micros": 123,
"storage_micros": 123,
"static_ip_micros": 123,
"billable_micros": 123,
"ai_micros": 123,
"ai_billed": true,
"ai_known": true
},
"estimate": {
"lines": [
{
"description": "<string>",
"kind": "<string>",
"micros": 123,
"cents": 123
}
],
"informational": [
{
"description": "<string>",
"kind": "<string>",
"micros": 123,
"cents": 123
}
],
"total_micros": 123,
"total_cents": 123
},
"credit": {
"balance_micros": 123,
"auto_top_up": {
"enabled": true,
"threshold_micros": 123,
"amount_micros": 123
}
},
"caps": {
"daily_micros": 123,
"sandbox_default_micros": 123,
"today_micros": 123
},
"billing_email": "<string>",
"provider": {
"configured": true,
"name": "<string>",
"plans": [
"<string>"
],
"offers": [
{
"name": "<string>",
"monthly_fee_micros": 123,
"included_usage_micros": 123,
"signup_credit_micros": 123,
"max_concurrent": 123,
"recorder_days": 123
}
]
},
"can_manage": true
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Authorizations
An API key (zode_tok_...). Create one in the console under API keys (https://console.zode.dev/tokens), or with zode login.
Response
Billing
Plan, this calendar month (UTC) of usage and the invoice the ledger
would build from it today, credit, caps and the billing email. AI
spend is shown, not billed (ai_billed), and unknown when the
flight recorder is off (ai_known). provider.configured is false
until billing opens: no cards, invoices or plan changes then.
⌘I