Skip to main content
GET
Read USD workspace settings
Read and update the workspace limits and plan budgets for mode bring-your-own-keys. Amounts are US dollars. The call uses the workspace API key’s BILLING_API scope. Writes run as the key’s service account owner.

Base URL

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

Prerequisites

  • API key with the BILLING_API scope
  • The key owner is a service account that has not been deleted and has an active Admin membership

Read settings

GET /billing/v1/bring-your-own-keys/settings returns the current settings.
workspaceUsageLimit caps included and extra chat and agent usage in usagePeriod. Personal API usage counts toward that cap, and so do Agent API calls with a workspace key when the agent budget is always with a limited amount. Other workspace API usage, workflow runs, and usage of the workspace backbone model do not. usagePeriodSpend is the usage counted toward that cap. monthlyBudgetPerPlan is the included allowance for Standard (standard) and Power user (power_user). Weekly and session budgets are derived and you cannot write them. The weekly amount is the monthly amount divided by 4. The session amount is the weekly amount divided by 3. An unlimited monthly budget stays unlimited on those windows. sessionBudgetPerPlan is null when session limits are off. The monthly amount sets those windows. Extra usage can start when the included weekly or session allowance is used up. It is not a promise that extra usage waits for a calendar month to end. usageRequestsEnabled lets members ask an admin for more usage. agentLimitBehavior.forced chooses what happens after a member or agent limit is reached:
  • null leaves the choice to the agent owner (Agent owner decides).
  • switch_model switches to the fallback model (Switch model). This requires a valid fallback.
  • block_usage stops the agent (Block usage).
fallbackModelId is the configured fallback. null uses the workspace backbone model. Forcing switch_model still requires that resulting model to be valid.
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.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Response

Successful response.

USD included and extra chat/agent usage; excludes workflow, API, and backbone-model usage. Weekly budgets are monthly / 4; session budgets are weekly / 3 and null when disabled. PATCH returns null spending; GET retrieves spending.

currency
enum<string>
required
Available options:
USD
usageRequestsEnabled
boolean
required
workspaceUsageLimit
object
required
monthlyBudgetPerPlan
object
required
sessionLimitsEnabled
boolean
required
agentLimitBehavior
object
required

Forcing switch_model requires a valid fallback model. null forced uses each agent setting. fallbackModelId is the configured override; null uses the workspace backbone fallback.

weeklyBudgetPerPlan
object
required
sessionBudgetPerPlan
object | null
required
usagePeriod
object
required
usagePeriodSpend
number | null
required
Required range: x >= 0