Get Job Run Cost Summary
curl --request GET \
--url https://api.dispersed.com/v1/job-runs/{uuid}/cost-summaryimport requests
url = "https://api.dispersed.com/v1/job-runs/{uuid}/cost-summary"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.dispersed.com/v1/job-runs/{uuid}/cost-summary', 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.dispersed.com/v1/job-runs/{uuid}/cost-summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.dispersed.com/v1/job-runs/{uuid}/cost-summary"
req, _ := http.NewRequest("GET", url, nil)
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.dispersed.com/v1/job-runs/{uuid}/cost-summary")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dispersed.com/v1/job-runs/{uuid}/cost-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"gross_spend": 123,
"refunds": 123,
"net_spend": 123,
"pending_hold": 123,
"calculated_cost": 123,
"transaction_count": 123,
"hourly_rate_usd": 123,
"currency": "USD",
"transactions": [
{
"amount_usd": 123,
"object": "compute_ledger_transaction",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>",
"job_run_uuid": "<string>",
"authorization_uuid": "<string>",
"consumer_profile_uuid": "<string>",
"consumer_account_uuid": "<string>",
"render_user_id": "<string>",
"render_credit_id": "<string>",
"memo": "<string>"
}
],
"authorization": {
"amount_usd": 123,
"approved": true,
"opened_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"object": "compute_ledger_authorization",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>",
"status_reason": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"consumer_account_uuid": "<string>",
"consumer_profile_uuid": "<string>",
"job_run_uuid": "<string>",
"render_user_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}Job Runs
Get Job Run Cost Summary
GET
/
v1
/
job-runs
/
{uuid}
/
cost-summary
Get Job Run Cost Summary
curl --request GET \
--url https://api.dispersed.com/v1/job-runs/{uuid}/cost-summaryimport requests
url = "https://api.dispersed.com/v1/job-runs/{uuid}/cost-summary"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.dispersed.com/v1/job-runs/{uuid}/cost-summary', 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.dispersed.com/v1/job-runs/{uuid}/cost-summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.dispersed.com/v1/job-runs/{uuid}/cost-summary"
req, _ := http.NewRequest("GET", url, nil)
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.dispersed.com/v1/job-runs/{uuid}/cost-summary")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dispersed.com/v1/job-runs/{uuid}/cost-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"gross_spend": 123,
"refunds": 123,
"net_spend": 123,
"pending_hold": 123,
"calculated_cost": 123,
"transaction_count": 123,
"hourly_rate_usd": 123,
"currency": "USD",
"transactions": [
{
"amount_usd": 123,
"object": "compute_ledger_transaction",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>",
"job_run_uuid": "<string>",
"authorization_uuid": "<string>",
"consumer_profile_uuid": "<string>",
"consumer_account_uuid": "<string>",
"render_user_id": "<string>",
"render_credit_id": "<string>",
"memo": "<string>"
}
],
"authorization": {
"amount_usd": 123,
"approved": true,
"opened_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"object": "compute_ledger_authorization",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>",
"status_reason": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"consumer_account_uuid": "<string>",
"consumer_profile_uuid": "<string>",
"job_run_uuid": "<string>",
"render_user_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}Path Parameters
Response
Job run cost summary retrieved successfully
Total spend amount (sum of all captures)
Total refund amount
Net spend (gross_spend - refunds)
Active authorization hold amount (0 if no active hold)
Calculated cost based on hourly_rate × duration
Number of transactions for this job run
Billing rule applied to this job run
Available options:
ONE_TIME, HOURLY, EXEMPT Hourly rate in USD
Available options:
USD List of billing transactions for this job run
Show child attributes
Show child attributes
Active or most recent authorization for this job run
Show child attributes
Show child attributes
⌘I