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

# Get Usage

> Get usage statistics and analytics for all services

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

### Query Parameters

<ParamField query="date_from" type="string">
  Start date (ISO 8601 format, e.g. `2026-04-01`)
</ParamField>

<ParamField query="date_to" type="string">
  End date (ISO 8601 format, e.g. `2026-04-13`)
</ParamField>

<ParamField query="period" type="string" default="month">
  Aggregation period: `day`, `week`, `month`, `year`
</ParamField>

## Response

Returns usage data for all services — TTS, STT, LLM, and Memory — aggregated by period.

<ResponseField name="usage_by_period" type="array">
  Time-series data with per-period breakdowns
</ResponseField>

<ResponseField name="usage_by_period[].period" type="string">
  Date string for the period
</ResponseField>

<ResponseField name="usage_by_period[].tts_characters" type="number">
  TTS characters used in this period
</ResponseField>

<ResponseField name="usage_by_period[].stt_minutes" type="number">
  STT minutes used in this period
</ResponseField>

<ResponseField name="usage_by_period[].cost_usd" type="number">
  TTS + STT cost in this period
</ResponseField>

<ResponseField name="usage_by_period[].llm_tokens" type="number">
  LLM tokens consumed in this period
</ResponseField>

<ResponseField name="usage_by_period[].llm_cost_usd" type="number">
  LLM cost in USD for this period
</ResponseField>

<ResponseField name="usage_by_period[].memory_units" type="number">
  Memory operations (chars, bytes, queries) in this period
</ResponseField>

<ResponseField name="usage_by_period[].memory_cost_usd" type="number">
  Memory cost in USD for this period
</ResponseField>

<ResponseField name="summary" type="object">
  Aggregated totals across all periods
</ResponseField>

<ResponseField name="summary.total_cost_usd" type="number">
  Total cost across all services (TTS + STT + LLM + Memory)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.60db.ai/analytics/usage?date_from=2026-04-01&date_to=2026-04-13" \
    -H "Authorization: Bearer your-api-key"
  ```

  ```javascript JavaScript theme={null}
  const usage = await client.getUsage({
    date_from: '2026-04-01',
    date_to: '2026-04-13'
  });
  ```

  ```python Python theme={null}
  usage = client.get_usage(
      date_from="2026-04-01",
      date_to="2026-04-13"
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "usage_by_period": [
      {
        "period": "2026-04-10",
        "tts_characters": 5000,
        "stt_minutes": 12.5,
        "cost_usd": 0.15,
        "llm_tokens": 8500,
        "llm_cost_usd": 0.017,
        "memory_units": 3200,
        "memory_cost_usd": 0.0003
      }
    ],
    "summary": {
      "tts_characters": 125000,
      "stt_minutes": 180,
      "llm_tokens": 45000,
      "llm_cost_usd": 0.09,
      "memory_units": 15000,
      "memory_cost_usd": 0.0015,
      "total_cost_usd": 3.59,
      "plan": "Starter",
      "limits": {
        "tts_characters": 30000,
        "stt_minutes": 120
      }
    }
  }
  ```
</ResponseExample>
