curl --request GET \
--url https://platformapi.comfy.org/deploy/v1/usage/serverless \
--header 'Authorization: Bearer <token>'import requests
url = "https://platformapi.comfy.org/deploy/v1/usage/serverless"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platformapi.comfy.org/deploy/v1/usage/serverless', 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://platformapi.comfy.org/deploy/v1/usage/serverless",
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://platformapi.comfy.org/deploy/v1/usage/serverless"
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://platformapi.comfy.org/deploy/v1/usage/serverless")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/deploy/v1/usage/serverless")
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{
"groupBy": "deployment",
"granularity": "day",
"timezone": "<string>",
"startingOn": "2023-11-07T05:31:56Z",
"endingBefore": "2023-11-07T05:31:56Z",
"groups": [
{
"key": "<string>",
"label": "<string>"
}
],
"buckets": [
{
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"groupKey": "<string>",
"chargedMicroUsd": 123,
"credits": 123
}
],
"breakdown": [
{
"groupKey": "<string>",
"chargedMicroUsd": 123,
"credits": 123,
"share": 123
}
],
"totalChargedMicroUsd": 123,
"totalCredits": 123,
"truncated": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Serverless spend, grouped and bucketed
Aggregates the workspace’s serverless usage into per-group totals and, unless granularity=none, a time series per group. Sorting and paging operate on groups, not buckets: the chosen page of groups determines which buckets come back, and totalChargedMicroUsd/totalCredits/truncated describe the whole filtered set rather than the returned page, so share stays honest against the real denominator.
GPU time, network-volume storage and container disk are all counted. Use groupBy=resource or the resource filter to tell them apart; without either they are summed into one figure per group. Buckets stored before the meter split container disk out of the endpoint charge carry it inside their compute figure, so a window spanning that change reports less container_disk than the hardware actually used.
Only what the workspace is billed is reported, and only usage actually billed is counted. Workspace scope always comes from the caller’s identity, never from a parameter.
curl --request GET \
--url https://platformapi.comfy.org/deploy/v1/usage/serverless \
--header 'Authorization: Bearer <token>'import requests
url = "https://platformapi.comfy.org/deploy/v1/usage/serverless"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platformapi.comfy.org/deploy/v1/usage/serverless', 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://platformapi.comfy.org/deploy/v1/usage/serverless",
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://platformapi.comfy.org/deploy/v1/usage/serverless"
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://platformapi.comfy.org/deploy/v1/usage/serverless")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/deploy/v1/usage/serverless")
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{
"groupBy": "deployment",
"granularity": "day",
"timezone": "<string>",
"startingOn": "2023-11-07T05:31:56Z",
"endingBefore": "2023-11-07T05:31:56Z",
"groups": [
{
"key": "<string>",
"label": "<string>"
}
],
"buckets": [
{
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"groupKey": "<string>",
"chargedMicroUsd": 123,
"credits": 123
}
],
"breakdown": [
{
"groupKey": "<string>",
"chargedMicroUsd": 123,
"credits": 123,
"share": 123
}
],
"totalChargedMicroUsd": 123,
"totalCredits": 123,
"truncated": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Query Parameters
Aggregation key. none collapses every row into a single group. resource answers one group per kind: compute, storage and container_disk. deployment answers one group per deployment, with every release it ran; release answers each release a deployment ran apart.
deployment, user, gpuClass, resource, none, release Repeatable. OR within the field. Omitted, or naming all three kinds, returns every kind together; naming only compute and storage leaves container_disk out.
100What a charge is for. compute is GPU time; storage is the deployment's network volume, which bills continuously whether or not anything runs; container_disk is the worker's own local disk, itemised inside the endpoint's bucket by the provider. It is not charged: its rows are recorded at zero charge, though buckets stored before that change carry a charge for it.
compute, storage, container_disk Whose spend to return. workspace (the default) is every row in the workspace, self is the deployments the caller created, user is the rows for the given userId. Spend is visible workspace-wide to every member, so no scope is role-gated; the workspace comes from the caller's identity and is the only boundary.
self, workspace, user Response
OK
Aggregation key. none collapses every row into a single group. resource answers one group per kind: compute, storage and container_disk. deployment answers one group per deployment, with every release it ran; release answers each release a deployment ran apart.
deployment, user, gpuClass, resource, none, release Was this page helpful?