Recompute the storage breakdown
Viewing v1, superseded by v2
curl --request POST \ --url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", 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;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown") .post(null) .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Post.new(url)request["Authorization"] = 'Bearer <token>'
response = http.request(request)puts response.read_bodyvar client = new RestClient("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown");var request = new RestRequest("", Method.Post);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);v1 is superseded. v1 was superseded by v2 on 2026-08-26. A sunset date has not been announced yet; v1 will be deprecated as a whole before removal. Migrate with the v2 migration guide.
Ask for the workspace’s storage breakdown to be computed afresh. Answers at once with the breakdown as it stands and is_breakdown_computing true; read the storage again to see the new one. A request while a breakdown is computing, or before breakdown_recompute_available_at (15 minutes after the last was computed), is ignored and answers with the breakdown as it stands. Requires settings admin.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”ID of the workspace that owns the resource.
ID of the workspace that owns the resource.
Header Parameters
Section titled “Header Parameters”Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with Idempotent-Replayed: true. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409. See the Idempotency section of the API description.
Responses
Section titled “ Responses ”Successful Response
object
Bytes the workspace stores now: a live count.
The most the workspace may store; null when it has no limit.
object
Stored files when the breakdown was computed.
Bytes those files hold.
Generated and uploaded files.
object
What the slice is: an origin (generated, uploaded), a content category (image, video, …), an age (under_30_days, 30_to_90_days, 90_to_365_days, over_1_year), a project id (none for files in no project) or a member’s principal id. Null for the slice that totals everything not listed.
What to call the slice.
Files in the slice.
Bytes those files hold.
Files by content category, most bytes first.
object
What the slice is: an origin (generated, uploaded), a content category (image, video, …), an age (under_30_days, 30_to_90_days, 90_to_365_days, over_1_year), a project id (none for files in no project) or a member’s principal id. Null for the slice that totals everything not listed.
What to call the slice.
Files in the slice.
Bytes those files hold.
Files by age, youngest first.
object
What the slice is: an origin (generated, uploaded), a content category (image, video, …), an age (under_30_days, 30_to_90_days, 90_to_365_days, over_1_year), a project id (none for files in no project) or a member’s principal id. Null for the slice that totals everything not listed.
What to call the slice.
Files in the slice.
Bytes those files hold.
The projects holding the most, then the rest together, then files in no project. A file in several projects counts in each.
object
What the slice is: an origin (generated, uploaded), a content category (image, video, …), an age (under_30_days, 30_to_90_days, 90_to_365_days, over_1_year), a project id (none for files in no project) or a member’s principal id. Null for the slice that totals everything not listed.
What to call the slice.
Files in the slice.
Bytes those files hold.
The members who created the most, then everyone else together.
object
What the slice is: an origin (generated, uploaded), a content category (image, video, …), an age (under_30_days, 30_to_90_days, 90_to_365_days, over_1_year), a project id (none for files in no project) or a member’s principal id. Null for the slice that totals everything not listed.
What to call the slice.
Files in the slice.
Bytes those files hold.
The largest stored files, largest first.
object
ID of the file.
The file’s name.
The file’s MIME type.
What kind of asset the file is.
Whether a generation produced the file or a person uploaded it.
Bytes the file holds.
When the file was created.
Who created the file, when known.
When the file was deleted; set in the trash only.
Who deleted the file; null for an automatic delete.
When the breakdown was computed. It trails used_bytes, which is live.
Whether a fresh breakdown is being computed.
When a fresh breakdown can next be asked for: 15 minutes after the last was computed. Null when it can be now.
Example
{ "breakdown": { "largest_files": [ { "content_category": "image", "origin": "generated" } ] }}Unauthenticated — missing or invalid Bearer token.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Resource not found.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Invalid input parameters, or an Idempotency-Key reused for a different request.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Rate limited — retry after the number of seconds in Retry-After.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Internal server error.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}