Skip to main content
The Billing API lets you change member plans, workspace and group limits, and agent budgets from your own systems. Use it when an admin request should update Langdock without someone opening the usage settings. You can also list usage requests and decline one that is still waiting. The User Management API invites people, changes roles, and deactivates members. This API does not. It also does not change group membership.
Call the routes below when GET /billing/v1/mode returns bring-your-own-keys. Dedicated deployments always return that mode, including when Langdock manages the model keys. Amounts are US dollars. Cloud workspaces can grant the Billing API scope only where Langdock has enabled it. If the mode is different, these routes return 409.

Before You Start

  • API key scope: BILLING_API on a workspace API key. In the scope picker the scope is labeled Billing API and sits in the Billing group, after User management and before Audit log. Personal keys cannot take this scope. Existing workspace keys do not gain it on their own.
  • Owner: The key owner is a service account that has not been deleted and has an active Admin membership. Writes run as that service account. If that membership is gone, calls return 403 with code BILLING_API_ADMIN_REQUIRED.
  • Names and emails: User objects always include id, the plan, and limits. They include email and name only when the same key also has USER_MANAGEMENT_API. Filtering users by email without that scope returns 403 with code USER_MANAGEMENT_API_REQUIRED.
Start with mode discovery, then call only the routes for that mode. The other mode returns 409 with code BILLING_MODE_MISMATCH and the workspace mode in details.mode.

Base URL

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

Billing mode

Plans in this mode are standard (Standard) and power_user (Power user). There is no seats route. A path that does not exist in this mode, such as a seats path, returns 404.

Limits

Send and read a limit in one of these shapes. Only limited includes amount.
A limited workspace amount must be greater than zero. A limited amount on a plan, a member, or a group may be zero. A limited agent budget must be greater than zero. Extra usage budgets in this mode also accept { "type": "none" }. Agent budgets accept none as well. none removes that extra allowance, or removes the separate agent budget. A PATCH must include at least one field you can write. Fields you omit stay as they are, including a plan you leave out of monthlyBudgetPerPlan. Unknown fields are rejected.

Lists and spend

Lists default to 50 items. Set limit from 1 to 250. Pass cursor from the previous page’s nextCursor, and keep the same filters. nextCursor is omitted on the last page. Treat the cursor as opaque. GET returns spend when the workspace shows per user spend. When that spend is hidden, the spend field is null. User, settings, and agent writes always return null for spend, so a write that already succeeded does not fail while spend is loading. Read the resource again to get spend.

Available endpoints

Errors

Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.