EvoHub DocsEvoHub Docs Sign in

Get itemised usage

Use with AI
View as MarkdownThis page as plain text, for pasting into an AI tool Open in ClaudeAsk Claude questions about this page Open in ChatGPTAsk ChatGPT questions about this page
Connect to Cursor / VS Code / ClaudeSearch and read these docs from your AI tool (MCP server)

MCP server URL

https://docs.evohub.io/mcp

Claude Code

claude mcp add --transport http evohub-docs https://docs.evohub.io/mcp

Claude (claude.ai and Claude Desktop): Settings → Connectors → Add custom connector, and paste the URL above.

Claude Desktop — claude_desktop_config.json

{
  "mcpServers": {
    "evohub-docs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://docs.evohub.io/mcp"
      ]
    }
  }
}

Cursor — ~/.cursor/mcp.json

{
  "mcpServers": {
    "evohub-docs": {
      "url": "https://docs.evohub.io/mcp"
    }
  }
}

VS Code — .vscode/mcp.json

{
  "servers": {
    "evohub-docs": {
      "type": "http",
      "url": "https://docs.evohub.io/mcp"
    }
  }
}
GET/api/v1/billing/usage

Usage per metric over a date range — by default the current UTC month. from is inclusive and to is exclusive, so from=2026-10-01&to=2026-11-01 is October.

With group_by=day, the answer has one entry per day that has usage, oldest first, each with its total EHU and its metrics. Otherwise it has one row per metric for the whole range.

Requires the billing:usage:read scope.

Authorization

Any one of:

Parameters

Query parameters

  • from string (date)
    First day, YYYY-MM-DD. Default the first day of the current month.
    Example: 2026-10-01
  • to string (date)
    The day after the last one, YYYY-MM-DD. Default the first day of next month.
    Example: 2026-11-01
  • group_by string
    day for a per-day breakdown; anything else (or nothing) totals per metric.
    One of: metric day

Responses

200

The usage.

Content type: application/json

Type: object

  • data UsageByMetric | UsageByDay

    One of:

    • UsageByMetric
      Show UsageByMetric properties
      • from string (date)
      • to string (date)
      • metrics array of UsageRow
        Show UsageRow properties
        • metric_key string
          Example: oncall.alert_ingested
        • quantity number
          How many of the metric's units were used.
        • ehu number
          Their EHU, exact.
    • UsageByDay
      Show UsageByDay properties
      • from string (date)
      • to string (date)
      • days array of object
        • day string (date)
        • ehu number
        • metrics array of UsageRow
          Show UsageRow properties
          • metric_key string
            Example: oncall.alert_ingested
          • quantity number
            How many of the metric's units were used.
          • ehu number
            Their EHU, exact.

400

from or to is not YYYY-MM-DD (INVALID_FROM, INVALID_TO), or to is not after from (INVALID_RANGE).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Example: STATEMENT_NOT_FOUND
    • message string required
      Example: No statement for that period.
    • request_id string

401

No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Example: STATEMENT_NOT_FOUND
    • message string required
      Example: No statement for that period.
    • request_id string

403

The key lacks the scope this endpoint needs (FORBIDDEN).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Example: STATEMENT_NOT_FOUND
    • message string required
      Example: No statement for that period.
    • request_id string

429

Too many requests (RATE_LIMITED). Wait for Retry-After seconds.

Headers

  • Retry-After integer
    Seconds to wait before retrying.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Example: STATEMENT_NOT_FOUND
    • message string required
      Example: No statement for that period.
    • request_id string

500

Usage could not be loaded (USAGE_FAILED). Retry later.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Example: STATEMENT_NOT_FOUND
    • message string required
      Example: No statement for that period.
    • request_id string

Example request

curl -X GET 'https://evohub.io/api/v1/billing/usage' \
  -H 'Authorization: Bearer <TOKEN>'