Skip to main content
PUT
Set a member budget

Overview

Gives an organization member a monthly budget in US dollars, so one person can’t use up the whole team’s balance. Admins can set the same budgets on the Members page.
Once the member’s spend this UTC month reaches the budget, their requests on the organization’s keys return 429 with code member_budget_exceeded until the 1st of next month (UTC), or until you raise or remove the budget. Their personal keys are not affected, and organization admins get an email when a member is paused. The change takes effect immediately: a budget at or below what the member already spent this month pauses them now, and raising it resumes them. Spend updates about every 30 minutes, so a member can go slightly past the budget before the pause lands. Send {"monthlyLimit": null} or call Remove Member Budget to remove the budget. Requires an organization API key owned by an organization admin.

Authorizations

Authorization
string
header
required

Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.

Path Parameters

userId
string
required

Which member’s budget to set. The member’s user id, from List member budgets.

Example:

"user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD"

Body

application/json

The monthly budget in USD, or null to remove it.

The budget to set.

monthlyLimit
required

Monthly budget in USD, from 1 to 1000000 with at most two decimals. Null removes the budget.

Example:

"50.00"

Response

The member’s budget after the change.

A member’s monthly budget and spend.

userId
string
required

The member’s user id.

Example:

"user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD"

monthlyLimit
string | null
required

Monthly budget in USD, two decimals. Null when the member has no budget.

Example:

"50.00"

spent
string
required

The member’s spend on the organization’s keys this UTC month, in USD at the organization’s prices. Updated about every 30 minutes.

Example:

"12.34"

paused
boolean
required

True once spend reached the budget. The member’s organization keys get 429 member_budget_exceeded until the budget is raised or removed, or the next UTC month starts.

Example:

false