Token usage and cost for a single RFT run
curl --request GET \
--url https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/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.primeintellect.ai/api/v1/billing/runs/{run_id}/usage",
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.primeintellect.ai/api/v1/billing/runs/{run_id}/usage"
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.primeintellect.ai/api/v1/billing/runs/{run_id}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/usage")
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{
"run_id": "<string>",
"training": {
"tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"cost_usd": 0
},
"inference": {
"tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"cost_usd": 0
},
"total_tokens": 123,
"total_cost_usd": 123,
"pricing": {
"training_per_mtok": 123,
"inference_input_per_mtok": 123,
"inference_output_per_mtok": 123
},
"run_name": "<string>",
"base_model": "<string>",
"status": "<string>",
"record_count": 0
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Billing
Token usage and cost for a single RFT run
Return the running token + cost totals for one RFT run.
Mirrors the per-row training data shown on the billing page (Training tokens, Inference input/output tokens, price per million tokens, and total cost) so an agent can poll this endpoint to monitor a live run.
GET
/
api
/
v1
/
billing
/
runs
/
{run_id}
/
usage
Token usage and cost for a single RFT run
curl --request GET \
--url https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/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.primeintellect.ai/api/v1/billing/runs/{run_id}/usage",
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.primeintellect.ai/api/v1/billing/runs/{run_id}/usage"
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.primeintellect.ai/api/v1/billing/runs/{run_id}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/billing/runs/{run_id}/usage")
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{
"run_id": "<string>",
"training": {
"tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"cost_usd": 0
},
"inference": {
"tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"cost_usd": 0
},
"total_tokens": 123,
"total_cost_usd": 123,
"pricing": {
"training_per_mtok": 123,
"inference_input_per_mtok": 123,
"inference_output_per_mtok": 123
},
"run_name": "<string>",
"base_model": "<string>",
"status": "<string>",
"record_count": 0
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
Per-run usage totals — drives prime train usage <run_id>.
Token + cost totals for a single usage type within a run.
Show child attributes
Show child attributes
Token + cost totals for a single usage type within a run.
Show child attributes
Show child attributes
Snapshotted per-million-token pricing used to bill the run.
Show child attributes
Show child attributes
Was this page helpful?