> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orthogonal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage

> View your API usage history

Returns your API usage history with per-call cost breakdowns and a spend summary.

## Authentication

Requires a valid API key via `Authorization: Bearer YOUR_API_KEY`.

## Query Parameters

<ParamField query="limit" type="number" default="50">
  Maximum number of usage events to return.
</ParamField>

<ParamField query="offset" type="number" default="0">
  Offset for pagination.
</ParamField>

<ParamField query="days" type="number" default="30">
  Number of days to look back.
</ParamField>

## Response

```json theme={null}
{
  "usage": [
    {
      "api": "apollo",
      "path": "/v1/people/match",
      "method": "POST",
      "timestamp": "2026-02-27T10:30:00Z",
      "cost": "$0.03",
      "status": "completed"
    },
    {
      "api": "hunter",
      "path": "/domain-search",
      "method": "POST",
      "timestamp": "2026-02-27T09:15:00Z",
      "cost": "$0.01",
      "status": "completed"
    }
  ],
  "totalSpent": "$0.04",
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 2,
    "total": 2
  }
}
```

### Response Fields

| Field               | Type     | Description                               |
| ------------------- | -------- | ----------------------------------------- |
| `usage`             | `array`  | List of API call events                   |
| `usage[].api`       | `string` | API slug                                  |
| `usage[].path`      | `string` | Endpoint path called                      |
| `usage[].method`    | `string` | HTTP method                               |
| `usage[].timestamp` | `string` | ISO 8601 timestamp                        |
| `usage[].cost`      | `string` | Cost in dollars                           |
| `usage[].status`    | `string` | Call status (`completed`, `failed`, etc.) |
| `totalSpent`        | `string` | Total spend in dollars                    |
| `pagination.total`  | `number` | Total number of events in the time range  |

## Example

<CodeGroup>
  ```bash cURL theme={null}
  # Last 7 days of usage
  curl 'https://api.orthogonal.com/v1/credits/usage?days=7&limit=20' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```bash CLI theme={null}
  # Default: last 30 days
  orth usage

  # Last 7 days, 10 results
  orth usage --days 7 --limit 10
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.orthogonal.com/v1/credits/usage?days=7', {
    headers: {
      'Authorization': `Bearer ${process.env.ORTHOGONAL_API_KEY}`
    }
  });

  const { usage, totalSpent } = await response.json();
  console.log(`Total spent: ${totalSpent}`);
  console.log(`API calls: ${usage.length}`);
  ```

  ```python Python theme={null}
  import requests
  import os

  response = requests.get(
      'https://api.orthogonal.com/v1/credits/usage',
      headers={'Authorization': f'Bearer {os.environ["ORTHOGONAL_API_KEY"]}'},
      params={'days': 7, 'limit': 20}
  )

  data = response.json()
  print(f"Spent {data['totalSpent']} across {data['pagination']['total']} calls")
  ```
</CodeGroup>
