Usage Export

Export API key usage data

Changed on

Export detailed usage and cost data grouped by API key

post/export/api-keys

Request

  • Base URL
    https://api.langdock.com
  • URL
    https://api.langdock.com/export/api-keys
  • Auth
    HTTP bearer

Request body

group_by'model'

Optional aggregation dimension.

Example request

{
  "from": {
    "date": "2024-01-01T00:00:00.000Z",
    "timezone": "UTC"
  },
  "to": {
    "date": "2024-01-31T23:59:59.999Z",
    "timezone": "UTC"
  }
}

Response

Export successful

successboolean required

Indicates if the export was successful

Example response

{
  "success": true,
  "data": {
    "filePath": "agents-usage/workspace-id/agents-usage-2024-01-01-2024-01-31-abc12345.csv",
    "downloadUrl": "https://storage.example.com/signed-url",
    "dataType": "assistants",
    "recordCount": 1250,
    "dateRange": {
      "from": "2024-01-01T00:00:00.000Z",
      "to": "2024-01-31T23:59:59.999Z"
    }
  }
}

Changes