> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morphllm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Member Budget

> Cap a member's monthly spend on your organization's keys at /api/v1/org/members/{userId}/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](https://www.morphllm.com/dashboard/members).

```bash theme={null}
curl -X PUT https://api.morphllm.com/api/v1/org/members/user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD/budget \
  -H "Authorization: Bearer $MORPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"monthlyLimit": "50.00"}'
```

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](https://docs.morphllm.com/api-reference/endpoint/org-member-budget-delete.md) to remove the budget. Requires an organization API key owned by an organization admin.


## OpenAPI

````yaml PUT /api/v1/org/members/{userId}/budget
openapi: 3.1.0
info:
  title: Morph API
  version: 1.2.0
  description: >-
    The Morph public API at api.morphllm.com: OpenAI- and Anthropic-compatible
    inference (chat completions, messages), Fast Apply code editing, Compact
    context compression, System One typed decisions, model listing, and
    dedicated endpoint management, agentic credit top-ups paid over x402, and
    organization member budgets. Model ids, prices, and context windows are
    served live at https://www.morphllm.com/api/models/json.
  contact:
    name: Morph
    url: https://morphllm.com
    email: info@morphllm.com
  license:
    name: Proprietary
    url: https://morphllm.com/privacy/tos
servers:
  - url: https://api.morphllm.com
    description: Production
security: []
tags:
  - name: chat
    description: >-
      OpenAI- and Anthropic-compatible chat inference, including Fast Apply and
      WarpGrep models.
  - name: compact
    description: Context compression for long agent conversations.
  - name: systemone
    description: 'Typed decisions: a state in, a probability distribution per question out.'
  - name: models
    description: Model listing.
  - name: dedicated
    description: Dedicated endpoint discovery, status, and cancellation.
  - name: credits
    description: Agentic credit top-ups paid in USDC over x402.
  - name: organization
    description: Organization member budgets.
  - name: telemetry
    description: Usage reporting hooks.
paths:
  /api/v1/org/members/{userId}/budget:
    put:
      tags:
        - organization
      summary: Set a member budget
      description: >-
        Sets a member’s monthly budget. It takes effect at once: a budget at or
        below the member’s spend this month pauses their organization keys now,
        and raising it resumes them. Requires an organization API key owned by
        an organization admin.
      operationId: setMemberBudget
      parameters:
        - schema:
            type: string
            description: The member’s user id, from List member budgets.
            example: user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD
          required: true
          description: Which member’s budget to set.
          name: userId
          in: path
      requestBody:
        description: The monthly budget in USD, or null to remove it.
        content:
          application/json:
            schema:
              type: object
              properties:
                monthlyLimit:
                  anyOf:
                    - type: string
                    - type: number
                    - type: 'null'
                  description: >-
                    Monthly budget in USD, from 1 to 1000000 with at most two
                    decimals. Null removes the budget.
                  example: '50.00'
              required:
                - monthlyLimit
              description: The budget to set.
              example:
                monthlyLimit: '50.00'
      responses:
        '200':
          description: The member’s budget after the change.
          content:
            application/json:
              example:
                userId: user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD
                monthlyLimit: '50.00'
                spent: '12.34'
                paused: false
              schema:
                $ref: '#/components/schemas/MemberBudget'
        '400':
          description: The budget is missing, out of range, or has more than two decimals.
          content:
            application/json:
              example:
                error: monthlyLimit must be a USD amount between 1 and 1000000
              schema:
                $ref: '#/components/schemas/OrgError'
        '401':
          $ref: '#/components/responses/OrgUnauthorized'
        '403':
          $ref: '#/components/responses/OrgForbidden'
        '404':
          description: No member with this user id belongs to the key’s organization.
          content:
            application/json:
              example:
                error: Member not found
              schema:
                $ref: '#/components/schemas/OrgError'
      security:
        - bearerAuth: []
components:
  schemas:
    MemberBudget:
      type: object
      properties:
        userId:
          type: string
          description: The member’s user id.
          example: user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD
        monthlyLimit:
          type:
            - string
            - 'null'
          description: >-
            Monthly budget in USD, two decimals. Null when the member has no
            budget.
          example: '50.00'
        spent:
          type: string
          description: >-
            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:
          type: boolean
          description: >-
            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
      required:
        - userId
        - monthlyLimit
        - spent
        - paused
      description: A member’s monthly budget and spend.
      example:
        userId: user_2xKq8T1fJ3mZ5bR9cW7vN4pL6hD
        monthlyLimit: '50.00'
        spent: '12.34'
        paused: false
    OrgError:
      type: object
      properties:
        error:
          type: string
          description: Why the request failed.
          example: Member not found
      required:
        - error
      description: Error body returned by the organization routes.
      example:
        error: Member not found
  responses:
    OrgUnauthorized:
      description: Missing or invalid Morph API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgError'
          example:
            error: Unauthorized
    OrgForbidden:
      description: >-
        The key is a personal key, or belongs to an organization member who is
        not an admin.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgError'
          example:
            error: Only an organization admin can manage member budgets
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at
        https://www.morphllm.com/dashboard/api-keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.