Skip to main content
This endpoint returns one settled row per API request made with a workspace or personal API key. Each row includes cost and token counts. It does not include prompt or completion text. For a total per API key, use Export API Key Usage. To download one row per API call as a CSV file from Settings > API instead, see API Usage Export.

Before You Start

  • Prerequisites and rate limits: See the Usage Export API overview.
  • Browser requests: Langdock intentionally blocks browser-origin requests to protect your API key. Use API keys server-side and store them securely. See API Key Best Practices.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Request

A from earlier than 366 days ago is treated as 366 days ago, and a to in the future is treated as now. If to is before from, the API returns 400 Bad Request.

Paging

Rows are oldest first. next_cursor is null on the last page. When it is a string, send it as cursor with the same from and to. An invalid cursor returns 400 Bad Request. An empty window returns 200 with data: [] and next_cursor: null.

When Rows Appear

For requests sent to the Model Gateway on gateway.langdock.com, id matches the x-request-id response header from that completion call. An x-request-id you send in the request does not become id. The row appears a few seconds later, once the cost is settled. Rows from the Completion API on api.langdock.com appear when the request finishes.

Data Included

Example