curl --request GET \
--url https://api.mobileboost.io/usage/sdk-sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mobileboost.io/usage/sdk-sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mobileboost.io/usage/sdk-sessions', 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.mobileboost.io/usage/sdk-sessions",
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.mobileboost.io/usage/sdk-sessions"
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.mobileboost.io/usage/sdk-sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobileboost.io/usage/sdk-sessions")
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{
"window": {
"days": 30,
"start": "2026-08-24T09:00:00Z",
"end": "2026-09-23T09:00:00Z"
},
"apiKeyId": null,
"truncated": false,
"totals": {
"runs": 47,
"failedRuns": 3,
"aiSteps": 1470,
"cachedSteps": 2940,
"cacheHitRate": 66.67
},
"byTestId": [
{
"testId": "checkout-flow",
"runs": 42,
"failedRuns": 3,
"aiSteps": 1260,
"cachedSteps": 2940,
"avgAiSteps": 30,
"cacheHitRate": 70,
"avgRuntimeSeconds": 184.6
},
{
"testId": null,
"runs": 5,
"failedRuns": 0,
"aiSteps": 210,
"cachedSteps": 0,
"avgAiSteps": 42,
"cacheHitRate": 0,
"avgRuntimeSeconds": 96.2
}
]
}{
"detail": "Invalid API key"
}Get SDK session usage
Retrieve how many AI steps your organisation’s SDK sessions used over the last days days, grouped by the test ID each session was started with. These are the numbers the Usage by test table on the usage dashboard shows.
Each session’s steps are counted from its step log:
- An AI step is a step the AI model had to decide.
- A cached step was replayed from the cache instead.
- Steps your own code performed are free and count as neither.
The cache hit rate is cachedSteps / (cachedSteps + aiSteps), as a percentage.
A test ID is the value your SDK passed when it started the session, returned exactly as it was recorded. Sessions started by a MobileBoost Platform test run carry that test’s ID. Sessions started without a test ID share one row, with testId set to null.
By default, sessions started with any of your API keys are included. Pass apiKeyId to see only the sessions one key started.
Any API key of your organisation can call this endpoint, including read-only audit keys. The organisation is taken from the API key. Results can be up to one minute old.
These numbers won’t add up to the monthly allowance on the usage dashboard, because the two measure different things:
- Monthly allowance: counts AI model calls from all your runs in the calendar month, including runs that don’t go through an SDK session. Vision and non-vision calls are weighted by the step factors in your plan.
- This endpoint: counts AI steps of SDK sessions only, unweighted, over the last
daysdays. A session counts in the window it started in.
An AI step usually takes one model call, but not always, so even for SDK sessions alone the two can differ.
curl --request GET \
--url https://api.mobileboost.io/usage/sdk-sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mobileboost.io/usage/sdk-sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mobileboost.io/usage/sdk-sessions', 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.mobileboost.io/usage/sdk-sessions",
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.mobileboost.io/usage/sdk-sessions"
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.mobileboost.io/usage/sdk-sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobileboost.io/usage/sdk-sessions")
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{
"window": {
"days": 30,
"start": "2026-08-24T09:00:00Z",
"end": "2026-09-23T09:00:00Z"
},
"apiKeyId": null,
"truncated": false,
"totals": {
"runs": 47,
"failedRuns": 3,
"aiSteps": 1470,
"cachedSteps": 2940,
"cacheHitRate": 66.67
},
"byTestId": [
{
"testId": "checkout-flow",
"runs": 42,
"failedRuns": 3,
"aiSteps": 1260,
"cachedSteps": 2940,
"avgAiSteps": 30,
"cacheHitRate": 70,
"avgRuntimeSeconds": 184.6
},
{
"testId": null,
"runs": 5,
"failedRuns": 0,
"aiSteps": 210,
"cachedSteps": 0,
"avgAiSteps": 42,
"cacheHitRate": 0,
"avgRuntimeSeconds": 96.2
}
]
}{
"detail": "Invalid API key"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
How many days to look back from now (1-90).
1 <= x <= 90Only include sessions started with this API key. Use the key ID: the part of the key's prefix after mb_live_, for example AbCdEfGhIjK for a key starting mb_live_AbCdEfGhIjK. Use legacy for keys MobileBoost issued to you directly, or unattributed for sessions from before MobileBoost recorded which key started a session. Omit it to include every session.
"AbCdEfGhIjK"
Response
Successful response
The time window the numbers cover.
Show child attributes
Show child attributes
The apiKeyId filter applied, or null when sessions from all keys are included.
true when more than 30,000 sessions fall in the window. Only the newest 30,000 are counted.
Totals across every session counted.
Show child attributes
Show child attributes
One row per test ID, ordered by aiSteps, highest first.
Show child attributes
Show child attributes

