Skip to content

Recompute the storage breakdown

Viewing v1, superseded by v2

POST
/v1/workspaces/{workspace_id}/storage/breakdown
curl --request POST \
--url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/breakdown \
--header 'Authorization: Bearer <token>'

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.

workspace_id
required
Workspace ID

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

Idempotency-Key
string
<= 255 characters

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.

Successful Response

Media typeapplication/json
WorkspaceStorageOutput
object
used_bytes
required
Used Bytes

Bytes the workspace stores now: a live count.

integer
quota_bytes
required
Quota Bytes

The most the workspace may store; null when it has no limit.

integer
nullable
breakdown
required
Any of:
StorageBreakdownOutput
object
total_files
required
Total Files

Stored files when the breakdown was computed.

integer
total_bytes
required
Total Bytes

Bytes those files hold.

integer
by_origin
required
By Origin

Generated and uploaded files.

Array<object>
StorageSliceOutput
object
key
required
Key

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.

string
nullable
label
required
Label

What to call the slice.

string
files
required
Files

Files in the slice.

integer
bytes
required
Bytes

Bytes those files hold.

integer
by_category
required
By Category

Files by content category, most bytes first.

Array<object>
StorageSliceOutput
object
key
required
Key

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.

string
nullable
label
required
Label

What to call the slice.

string
files
required
Files

Files in the slice.

integer
bytes
required
Bytes

Bytes those files hold.

integer
by_age
required
By Age

Files by age, youngest first.

Array<object>
StorageSliceOutput
object
key
required
Key

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.

string
nullable
label
required
Label

What to call the slice.

string
files
required
Files

Files in the slice.

integer
bytes
required
Bytes

Bytes those files hold.

integer
by_project
required
By Project

The projects holding the most, then the rest together, then files in no project. A file in several projects counts in each.

Array<object>
StorageSliceOutput
object
key
required
Key

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.

string
nullable
label
required
Label

What to call the slice.

string
files
required
Files

Files in the slice.

integer
bytes
required
Bytes

Bytes those files hold.

integer
by_member
required
By Member

The members who created the most, then everyone else together.

Array<object>
StorageSliceOutput
object
key
required
Key

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.

string
nullable
label
required
Label

What to call the slice.

string
files
required
Files

Files in the slice.

integer
bytes
required
Bytes

Bytes those files hold.

integer
largest_files
required
Largest Files

The largest stored files, largest first.

Array<object>
StoredFileOutput
object
file_id
required
File ID

ID of the file.

string format: uuid
name
required
Name

The file’s name.

string
content_type
required
Content Type

The file’s MIME type.

string
content_category
required
FileContentCategory

What kind of asset the file is.

string
Allowed values: image video mesh audio pose safetensors playable spine font world pbr_materials landing_page other
origin
required
StoredFileOrigin

Whether a generation produced the file or a person uploaded it.

string
Allowed values: generated uploaded
size_bytes
required
Size Bytes

Bytes the file holds.

integer
created_at
required
Created At

When the file was created.

string format: date-time
created_by_name
required
Created By Name

Who created the file, when known.

string
nullable
deleted_at
required
Deleted At

When the file was deleted; set in the trash only.

string format: date-time
nullable
deleted_by_name
required
Deleted By Name

Who deleted the file; null for an automatic delete.

string
nullable
breakdown_computed_at
required
Breakdown Computed At

When the breakdown was computed. It trails used_bytes, which is live.

string format: date-time
nullable
is_breakdown_computing
required
Is Breakdown Computing

Whether a fresh breakdown is being computed.

boolean
breakdown_recompute_available_at
required
Breakdown Recompute Available At

When a fresh breakdown can next be asked for: 15 minutes after the last was computed. Null when it can be now.

string format: date-time
nullable
Example
{
"breakdown": {
"largest_files": [
{
"content_category": "image",
"origin": "generated"
}
]
}
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
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.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

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.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}