DocsUsage Logs
Billing

GET /v1/usage/logs

Fetch detailed usage history for request-level tables and billing visibility.

GET /v1/usage/logsScope: Depends on API key scopes configured in backend

Best for

Teams building detailed billing tables and usage history pages.

Request history
Billing details
Per-request model tracking

How to call it

bash

curl --request GET \
  --url "https://api.midsync.dev/v1/usage/logs?page=1&limit=20" \
  --header "Authorization: Bearer <midsync_api_key>"

What this API is for

Use this endpoint for detailed usage tables.

It is best suited for history, filters, and billing drill-down views.

Common query params

page

Optional. Current page number.

limit

Optional. Page size.

model

Optional. Filter by model id.

from

Optional. Start date in ISO string.

to

Optional. End date in ISO string.

Response fields

logs

Array of usage records.

model

Model used for the request.

pointsCharged

Points charged for that request when applicable.

usage

Token or usage metrics when relevant.

createdAt

Request timestamp.

Logs response shape

Logs response shape

json

{
  "logs": [
    {
      "id": "log_123",
      "model": "gpt-5-4",
      "mode": "responses",
      "pointsCharged": 0.21,
      "creditsConsumed": 0.41,
      "usage": {
        "inputTokens": 2541,
        "outputTokens": 44,
        "reasoningTokens": 0,
        "totalTokens": 2585
      },
      "createdAt": "2026-04-12T10:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 100
  }
}

Frontend notes

  • Use logs for detailed tables, not summary cards.
  • Expose model, time, and charged points clearly.
  • Keep filtering simple so customers can trace spend.

Ready to test with your own key?

Create a general API key in Settings, then come back here to copy a request example.

Open API Keys