Skip to content

List workspace member usage

Viewing v2, the current version

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

Unchanged from v1. This endpoint’s documented request and response schemas are identical in v1 and v2 — change the /v1 prefix to /v2. Schema equality is not a promise about behavior, so keep your usual smoke tests.

Every member’s usage and usage caps, a page at a time, in the order of listWorkspaceMembers. Each member reads as getWorkspaceMemberUsage does: Creative Units spent between two UTC dates, in total and per day or per calendar month, with the caps they meter against now. By day it defaults to the last 30 days and spans at most 365; by month it defaults to the last 12 months and spans at most 731 days. Requires billing 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.

start_date
Start Date

First day to report (UTC), inclusive. Defaults to 29 days before end_date by day, or the first of the month 11 months before end_date by month.

string format: date
nullable

First day to report (UTC), inclusive. Defaults to 29 days before end_date by day, or the first of the month 11 months before end_date by month.

end_date
End Date

Last day to report (UTC), inclusive. Defaults to today.

string format: date
nullable

Last day to report (UTC), inclusive. Defaults to today.

granularity
UsageGranularity

The size of each bucket: day or month (UTC).

string
default: day
Allowed values: day month

The size of each bucket: day or month (UTC).

limit
Limit

Maximum number of results to return.

integer
default: 20 >= 1 <= 100

Maximum number of results to return.

cursor
Cursor

Cursor from a previous response to fetch the next page.

string
nullable

Cursor from a previous response to fetch the next page.

Successful Response

Media typeapplication/json
ListMemberUsageOutput
object
members
required
Members
Array<object>
MemberUsageOutput
object
principal_id
required
Principal ID

The member whose usage this is.

string format: uuid
start_date
required
Start Date

First day of the reported window (UTC), inclusive.

string format: date
end_date
required
End Date

Last day of the reported window (UTC), inclusive.

string format: date
granularity
required
UsageGranularity

The size of each bucket: a UTC day or a UTC calendar month.

string
Allowed values: day month
total_creative_units
required
Total Creative Units

Creative Units the member spent in the workspace over the window.

number
buckets
required
Buckets

Creative Units the member spent per bucket, oldest first. A bucket with no spend is left out. By month, the first and last months count only the days inside the window.

Array<object>
MemberUsageBucket
object
start_date
required
Start Date

First day of the bucket (UTC): the day itself, or the first of the month.

string format: date
creative_units
required
Creative Units

Creative Units the member spent in the bucket, inside the window.

number
limits
required
Limits

The usage caps the member meters against now, outside any project, each with their spend in its current period rather than in the reported window. Empty when no cap applies, and below Enterprise.

Array<object>
MemberUsageLimit
object
source
required
UsageLimitSource

Where the cap is set: the workspace (or one above it), a group, or the membership itself.

string
Allowed values: workspace project group membership
group_id
Group ID

The group that sets the cap, for a group cap.

string format: uuid
nullable
group_name
Group Name

The name of that group, for a group cap.

string
nullable
period
required
UsageLimitPeriod

How often the cap resets: daily, weekly or monthly (UTC).

string
Allowed values: daily weekly monthly
mode
required
UsageLimitMode

Warn tells the member they are past the cap; block also stops anything that charges Creative Units.

string
Allowed values: warn block
cu_limit
required
CU Limit

Creative Units the member may spend in each period.

number
warn_threshold_pct
required
Warn Threshold Percent

Percent of the cap at which the member is warned.

integer
cu_used
required
CU Used

Creative Units the member has spent in the current period.

number
state
required
UsageLimitState

Where the member stands against the cap: ok, warning or blocked.

string
Allowed values: ok warning blocked
period_resets_at
required
Period Resets At

When the current period ends and the cap resets.

string format: date-time
pagination
required
PaginationOutput
object
next_cursor
Next Cursor

Cursor to use to get the next page

string
nullable
has_more_results
required
Has More Results

If there are more results to page through

boolean
total_count
Total Count

Total number of results matching the query

integer
nullable
Example
{
"members": [
{
"granularity": "day",
"limits": [
{
"source": "workspace",
"period": "daily",
"mode": "warn",
"state": "ok"
}
]
}
]
}

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"
}