> **Reading as an AI agent?** This is the Markdown version of https://docs.meshy.ai/api/v2/usage, part of the Meshy API v2 docs.
>
> - v2 docs index: https://docs.meshy.ai/api/v2/llms.txt
> - All v2 pages in one file: https://docs.meshy.ai/api/v2/llms-full.txt
> - OpenAPI spec for v2: https://docs.meshy.ai/api/v2/openapi.yaml

---

# Usage API

List your team's finished API tasks and the credits each one used, for billing exports and cost reports.

> **Note:** Moving from v1? The parameters and records are the same as on `GET /openapi/v1/usage/tasks`. The response is `{"data": [...], "has_more": ...}` instead of a bare array. See [Endpoint paths in the migration reference](/api/migrate-to-v2/reference#endpoints).

To call this endpoint, use an API key of an active member of a **Studio** or **Enterprise** team. Any member can call it, not only owners and admins. With any other API key, the request returns `403`.

---

## GET /openapi/v2/usage/tasks -- List usage records

Returns one page of your team's usage records, newest first by default. Without `start_time` and `end_time`, the records cover the last 30 days. Calling this endpoint is free.

The records include these tasks:

* API tasks that finished as `SUCCEEDED` or `FAILED`
* Tasks of every current member of the team, from any of their API keys
* Tasks you deleted, and tasks whose files have expired

The records leave out these tasks:

* Tasks that are still `PENDING` or `IN_PROGRESS`, and `CANCELED` tasks
* Tasks of people who have left the team

They also leave out these tasks, even though they use the same credits:

* Creative Lab tasks
* Tasks that Meshy's AI agents ran
* Work done in the Meshy web app

A task appears after it finishes, in the window of its `created_at`. Before you reconcile, pull recent windows again.

If your team has a data retention period, the window starts no earlier than that period allows.

### Parameters

  - `start_time` · *string*

  The start of the window, as an RFC 3339 timestamp, for example `2026-09-01T00:00:00Z`. The records include tasks created at or after this time. Leave it out to start the window 30 days before `end_time`.

  The window can span at most 366 days. A longer window returns `400`, so split a longer export into several windows.

  In a URL, write the `+` of an offset such as `+08:00` as `%2B`, or use `Z`. Otherwise the `+` is read as a space, and the request returns `400`.

  - `end_time` · *string*

  The end of the window, as an RFC 3339 timestamp. The records include tasks created before this time. Leave it out to end the window at the time of your request.

  - `endpoints` · *string*

  A comma-separated list of the endpoints to include, by the same names as the `endpoint` field. Leave it out to include every endpoint. An unknown name returns `400`.

  Available values:
  * `text-to-3d`: one-call, preview, and refine Text to 3D tasks
  * `text-to-3d-preview`: preview tasks only
  * `text-to-3d-refine`: refine tasks only
  * `image-to-3d`
  * `multi-image-to-3d`
  * `remesh`
  * `convert`
  * `resize`
  * `uv-unwrap`
  * `retexture`
  * `rig`
  * `rig-check`
  * `animate`
  * `text-to-motion`
  * `text-to-image`
  * `image-to-image`
  * `print-multi-color`
  * `print-analyze`
  * `print-repair`
  * `print-split`
  * `relief`

  - `status` · *string*

  The status to include, `SUCCEEDED` or `FAILED`. Leave it out to include both. Any other value returns `400`.

  - `page_num` · *integer* · default: `1`

  The page to return, from `1` to `255`. A value above `255` returns `400`. One window holds at most 255 pages, so split a large export into shorter windows.

  - `page_size` · *integer* · default: `10`

  Number of records per page, from `1` to `100`. A value from `101` to `255` returns 100 records, and a value above `255` returns `400`.

  - `sort_by` · *string* · default: `-created_at`

  The sort order.

  Available values:
  * `-created_at`: newest first
  * `+created_at`: oldest first

  In a URL, write `+` as `%2B`. Otherwise the `+` is read as a space, and the request returns `400`.

### Returns

  - `data` · *array*

  The [usage records](#the-usage-record-object) on this page. An empty array when there are none.

  - `has_more` · *boolean*

  Whether there's another page. If `true`, request the next page with `page_num` plus one. `false` on the last page.

The response has no total count.

### Failure modes

  - `400 - Bad Request`

  A parameter is invalid. The error message says which one. For example:
  * `start_time must be an RFC 3339 timestamp, e.g. 2026-01-01T00:00:00Z`
  * `end_time must be after start_time`
  * `time range cannot exceed 1 year`
  * `invalid endpoint: "rigging"`
  * `invalid sort_by: " created_at"`

  Fix the parameter, then send the request again. See [Errors](https://docs.meshy.ai/api/v2/errors.md#request-errors).

  - `401 - Unauthorized`

  The API key is missing or invalid. Check the `Authorization` header.

  - `403 - Forbidden`

  The API key's account isn't an active member of a Studio or Enterprise team. The message is `This endpoint is available on Studio and Enterprise plans`. Use an API key of a Studio or Enterprise team member.

  - `429 - Too Many Requests`

  You sent too many requests. Wait the number of seconds in `Retry-After`, then retry.

**cURL**

```bash
# List September's usage, 50 records per page
curl "https://api.meshy.ai/openapi/v2/usage/tasks?page_size=50&start_time=2026-09-01T00:00:00Z&end_time=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer ${MESHY_API_KEY}"
```

```javascript
// Export every usage record from September, one page at a time
const params = new URLSearchParams({
  page_size: "100",
  start_time: "2026-09-01T00:00:00Z",
  end_time: "2026-10-01T00:00:00Z",
});
const records = [];
for (let page = 1; ; page++) {
  params.set("page_num", String(page));
  const response = await fetch(
    `https://api.meshy.ai/openapi/v2/usage/tasks?${params}`,
    { headers: { Authorization: `Bearer ${process.env.MESHY_API_KEY}` } },
  );
  if (!response.ok) throw new Error(await response.text());
  const { data, has_more } = await response.json();
  records.push(...data);
  if (!has_more) break;
}
const credits = records.reduce((sum, r) => sum + r.consumed_credits, 0);
console.log(records.length, credits);
```

```python
import os
import requests

# Export every usage record from September, one page at a time
params = {
    "page_size": 100,
    "start_time": "2026-09-01T00:00:00Z",
    "end_time": "2026-10-01T00:00:00Z",
}
records = []
page = 1
while True:
    response = requests.get(
        "https://api.meshy.ai/openapi/v2/usage/tasks",
        headers={"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"},
        params={**params, "page_num": page},
    )
    response.raise_for_status()
    body = response.json()
    records.extend(body["data"])
    if not body["has_more"]:
        break
    page += 1
print(len(records), sum(r["consumed_credits"] for r in records))
```

**Response**

```json
{
  "data": [
    {
      "task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
      "endpoint": "image-to-3d",
      "status": "SUCCEEDED",
      "created_at": 1790640079880,
      "finished_at": 1790640138211,
      "consumed_credits": 30,
      "api_key_name": "production",
      "api_key_suffix": "a1b2",
      "metadata": {
        "user": "alex@example.com",
        "team": "fab"
      }
    },
    {
      "task_id": "018a210d-1c22-7e0f-9d3a-4a5b6c7d8e9f",
      "endpoint": "text-to-3d",
      "status": "FAILED",
      "created_at": 1790639000000,
      "finished_at": 1790639030000,
      "consumed_credits": 0,
      "api_key_name": "production",
      "api_key_suffix": "a1b2",
      "metadata": {}
    }
  ],
  "has_more": true
}
```

---

## Usage record object

  - `task_id` · *string*

  The task ID. To read a task you created, use [`GET /openapi/v2/tasks/{id}`](https://docs.meshy.ai/api/v2/tasks.md#get-a-task) until the task is deleted or expires. A task that a teammate created returns `404` there, because each API key reads only its own account's tasks.

  - `endpoint` · *string*

  The task's [type](https://docs.meshy.ai/api/v2/tasks.md#task-types), for example `image-to-3d`, `rig`, or `print-repair`. A one-call Text to 3D task shows `text-to-3d`, and a preview or refine task shows `text-to-3d-preview` or `text-to-3d-refine`.

  Older records can have names of retired endpoints, which the `endpoints` filter doesn't accept.

  - `status` · *string*

  The task's final status, `SUCCEEDED` or `FAILED`.

  - `created_at` · *integer*

  Time the task was created, in Unix milliseconds.

  - `finished_at` · *integer | null*

  Time the task finished, in Unix milliseconds. `null` if the task has no finish time.

  - `consumed_credits` · *integer*

  Number of credits the task used, after refunds. `0` for a failed task, and for free tasks such as Analyze Printability.

  - `api_key_name` · *string*

  The name of the API key that ran the task. For a task run with a Meshy CLI login, it's `Meshy CLI`.

  It's an empty string in these cases:
  * The task was never charged, for example an Analyze Printability task, which is free.
  * The API key has been deleted.
  * The task ran through another app's login.
  * The API key was created in the last few minutes.

  - `api_key_suffix` · *string*

  The last four characters of that API key, to tell keys with the same name apart. An empty string whenever `api_key_name` is empty, and for Meshy CLI logins.

  - `metadata` · *object*

  The tags sent in the `X-Meshy-Metadata` header when the task was created. `{}` if none. See [Metadata](https://docs.meshy.ai/api/v2/metadata.md).

**Usage record**

```json
{
  "task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "endpoint": "image-to-3d",
  "status": "SUCCEEDED",
  "created_at": 1790640079880,
  "finished_at": 1790640138211,
  "consumed_credits": 30,
  "api_key_name": "production",
  "api_key_suffix": "a1b2",
  "metadata": {
    "user": "alex@example.com",
    "team": "fab"
  }
}
```
