# Get workspace member usage

GET

/v1/workspaces/{workspace\_id}/members/{principal\_id}/usage

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

```python
import requests


url = "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage"


headers = {"Authorization": "Bearer <token>"}


response = requests.get(url, headers=headers)


print(response.json())
```

```js
const url = 'https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage';
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);
}
```

```go
package main


import (
  "fmt"
  "net/http"
  "io"
)


func main() {


  url := "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage"


  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
<?php


$curl = curl_init();


curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage",
  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;
}
```

```java
OkHttpClient client = new OkHttpClient();


Request request = new Request.Builder()
  .url("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage")
  .get()
  .addHeader("Authorization", "Bearer <token>")
  .build();


Response response = client.newCall(request).execute();
```

```ruby
require 'uri'
require 'net/http'


url = URI("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage")


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_body
```

```csharp
var client = new RestClient("https://api.app.layer.ai/api/v1/workspaces/:workspace_id/members/:principal_id/usage");
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer <token>");
var response = client.Execute(request);
```

* Layer API

> **v1 is superseded.** v1 was superseded by [v2](/docs/v2/rest-api/operations/getworkspacememberusagev2) 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](/docs/migration).

Creative Units one member spent in the workspace between two UTC dates, in total and per day or per calendar month, with the usage 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. Reading your own usage requires workspace billing access, another member’s requires billing admin.

## Authorizations

* **[bearerAuth](/docs/v1/rest-api#bearerauth)**
* **[oauth2](/docs/v1/rest-api#oauth2)**
* **[serviceAccount](/docs/v1/rest-api#serviceaccount)**  
billing:read

## Parameters 

### Path Parameters

**workspace\_id**

required

_Workspace ID_

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

**principal\_id**

required

_Principal ID_

ID of the member: a user, service account or API key.

string format: uuid

ID of the member: a user, service account or API key.

### Query Parameters

**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).

## Responses 

### 200

Successful Response

_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

##### Example

```json
{
  "granularity": "day",
  "limits": [
    {
      "source": "workspace",
      "period": "daily",
      "mode": "warn",
      "state": "ok"
    }
  ]
}
```

### 401

Unauthenticated — missing or invalid Bearer token.

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

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

### 403

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

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

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

### 404

Resource not found.

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

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

### 409

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

**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

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

### 422

Invalid input parameters, or an `Idempotency-Key` reused for a different request.

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

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

### 429

Rate limited — retry after the number of seconds in `Retry-After`.

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

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

### 500

Internal server error.

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

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