orgs

Export Granular Usage Csv

Changed on

Export granular usage data as CSV.

Same kind semantics as /granular-usage. The CSV's value columns vary by kind:

  • traces: single Traces column.
  • langsmith_deployments: Nodes Executed, Agent Runs, Agent Uptime (seconds) columns. Dimension columns are identical across kinds.
get/api/v1/orgs/current/billing/granular-usage/export

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v1/orgs/current/billing/granular-usage/export
  • Auth
    • API key in header X-API-Key
    • or API key in header X-Organization-Id
    • or HTTP bearer

Query parameters

start_timestring date-time required
end_timestring date-time required
workspace_idsstring[] nullable
group_by'user' | 'api_key' | 'project' | 'workspace' | 'trace_tier'

Dimensions for grouping granular usage data.

kind'traces' | 'langsmith_deployments'

Which billable usage domain a granular-usage query targets.

  • traces: trace counts.
  • langsmith_deployments: LangSmith Deployment metrics (nodes executed, agent runs, agent uptime).

Default is traces for backward compatibility — existing callers of GET /granular-usage without a kind query param get the same response shape they always did.

trace_tier'longlived' | 'shortlived'

Response

Successful Response

unknown required

Changes

    • breaking

      the / response's property type changed from object to string for status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • info

      added the new optional query request parameter kind

    • info

      added the new optional query request parameter trace_tier

    • info

      the query request parameter workspace_ids became optional

    • info

      added the new enum value trace_tier to the query request parameter group_by

    • info

      query request parameter workspace_ids list-of-types was widened by adding types null

    • info

      for the query request parameter workspace_ids, the type was generalized from array to no type