Skip to main content
PATCH
Update 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

Update settings

PATCH accepts usageRequestsEnabled, workspaceUsageLimit, monthlyBudgetPerPlan, sessionLimitsEnabled, and agentLimitBehavior. Send at least one of them. A plan you omit from monthlyBudgetPerPlan keeps its budget. Nested fields you omit from agentLimitBehavior stay as they are.
The response matches GET, with usagePeriodSpend set to null. Read the settings again to get spend. A limited workspaceUsageLimit must be greater than zero. A limited plan budget may be zero.
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"

Body

application/json
usageRequestsEnabled
boolean
workspaceUsageLimit
object
monthlyBudgetPerPlan
object

Omitted plans keep their current values.

sessionLimitsEnabled
boolean
agentLimitBehavior
object

Omitted fields keep their current values. The resulting switch_model configuration must have a valid fallback model.

Response

Updated resource. Spending is null; GET retrieves spending.

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