Get workspace storage
Viewing v1, superseded by v2
curl --request GET \ --url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage';const options = {method: 'GET', 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"
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(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", 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;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage") .get() .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")
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_bodyvar client = new RestClient("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage");var request = new RestRequest("", Method.Get);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.
What the workspace stores against its limit, and a breakdown of its files by origin, category, age, project and member, with its largest files. The breakdown is computed in the background, nightly and on request, so it trails the live used_bytes; the first read asks for one. 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.
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"}