Skip to content

Get workspace usage

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

Creative Units balance plus total and per-day consumption over the last days days.

workspace_id
required
Workspace Id
string format: uuid
days
Days

How many days back to report.

integer
default: 30 >= 1 <= 365

How many days back to report.

Successful Response

Media typeapplication/json
WorkspaceUsageOutput
object
balance_creative_units
required
Balance Creative Units

Current Creative Units balance.

number
reserved_creative_units
required
Reserved Creative Units

Creative Units reserved by in-flight generations.

number
available_creative_units
required
Available Creative Units

Balance minus reserved: what’s spendable right now.

number
period_start
required
Period Start

Start of the reported window (UTC date).

string
period_end
required
Period End

End of the reported window (UTC date).

string
total_creative_units
required
Total Creative Units

Total Creative Units consumed over the window.

number
daily
required
Daily

Per-day Creative Units consumption over the window, oldest first.

Array<object>
DailyUsage
object
date
required
Date

Calendar day (UTC), ISO format YYYY-MM-DD.

string
creative_units
required
Creative Units

Creative Units consumed on this day across all models.

number
Examplegenerated
{
"balance_creative_units": 1,
"reserved_creative_units": 1,
"available_creative_units": 1,
"period_start": "example",
"period_end": "example",
"total_creative_units": 1,
"daily": [
{
"date": "example",
"creative_units": 1
}
]
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Forbidden — insufficient permissions.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Invalid input parameters.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Rate limited — too many concurrent requests.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}