Skip to main content
This endpoint exports agent usage data including message counts per agent, active user counts, and usage trends over time.

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.
The legacy path /export/assistants remains available and returns the same data.

Data Included

By default, the agent export returns one row per agent for the selected period. private means the agent is not shared beyond the owner. shared_users means people, groups, or API keys. shared_workspace means the whole workspace. Workspace sharing takes precedence over narrower grants. Both columns are included in JSON and CSV even when user-level data is disabled. On BYOK workspaces they follow the token columns, before the budget columns. An agent can have several users in the period and still be private. agent_budget_limit_current and agent_budget_utilization_pct_current are null in JSON and empty cells in the CSV. always is Limit usage set to Always. after_user_limits is After user limits. none means the agent has no limit of its own, or the workspace is Langdock Cloud without BYOK and extra usage is off. The limit and consumption are in EUR on Langdock Cloud without BYOK and in USD on BYOK workspaces, including dedicated deployments. Consumption is rounded to two decimal places and stays a number for none. agent_budget_utilization_pct_current is a four-decimal ratio and can be above 1. It is 0 when the limit is positive and nothing was paid in the period. The limit is the configuration at export time.

Additional Columns for BYOK Workspaces

cache_hit_rate is sum_cached_prompt_tokens / sum_prompt_tokens as a four-decimal ratio from 0 to 1, not a percent. It is 0 when there is input and no cache reads. It is blank when total input is 0. If cached tokens exceed total input, the value is capped at 1.0000. total_cost_usd is the agent’s cost for the selected period, rounded to two decimal places. It includes all of that cost, not only the part paid from the agent’s limit.
Because BYOK workspaces supply their own model keys, Langdock can provide token consumption data directly. This is not possible when obtaining your models directly through Langdock.

Grouped Export

Use group_by=model to return one row per agent and model. In grouped rows, model is the model that produced the usage, not the model configured on the agent. Agent-level KPI fields are omitted in grouped mode. visibility and assistant_created_at stay on each row. The columns agent_budget_mode, agent_budget_limit_current, agent_budget_consumption_in_period, and agent_budget_utilization_pct_current are omitted. Grouped BYOK rows include total_cost_usd.