# Workspace

> The key's workspace, its credit balance, today's API budget and the credit ledger.

Source: https://imario.ai/docs/api/reference/workspace

Base URL `https://api.imario.ai/v1`. Each call needs a key that holds the scope shown and acts with at least the role shown ([Authentication](https://imario.ai/docs/api/authentication)). Errors are described in [API errors](https://imario.ai/docs/api/errors).

## Retrieve the key's workspace

`GET /v1/workspace`

**Scope** `workspace:read` · **Role** any member

The workspace this key belongs to, its billing mode and API daily budget, and what the key is: its name, whether it is personal or a service account, the role it acts with, its scopes (`null` = full access) and whether it is a live or a test key.

**Example**

```bash
curl https://api.imario.ai/v1/workspace \
  -H "Authorization: Bearer $IMARIO_API_KEY"
```

## Credit balance and today's API budget

`GET /v1/usage`

**Scope** `workspace:read` · **Role** any member

The balance of the wallet that pays for this key's work (`paid_by`: the workspace's pool, or a member's own wallet), and the workspace's API daily budget: the ceiling, what keys spent today (UTC) and what remains. `null` daily budget = no ceiling.

**Example**

```bash
curl https://api.imario.ai/v1/usage \
  -H "Authorization: Bearer $IMARIO_API_KEY"
```

## List credit transactions

`GET /v1/credit-transactions`

**Scope** `workspace:read` · **Role** any member

The paying wallet's ledger, newest first: grants, charges and refunds with the balance after each. `api_key_id` names the key a charge was made with (`null` for work done in the web app).

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | `integer` | No | How many objects to return (1-100). Default `20`. |
| `cursor` | query | `string` | No | The `next_cursor` of the previous page. Up to 200 characters. |

**Example**

```bash
curl https://api.imario.ai/v1/credit-transactions \
  -H "Authorization: Bearer $IMARIO_API_KEY"
```

**Response**

Returns a list: `{"object": "list", "data": [...], "has_more": false, "next_cursor": null}`. See [Pagination](https://imario.ai/docs/api/pagination).
