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

# Update Spending Limits

> Update the current user's USDC spending limit settings

## Overview

Updates the user's x402 spending limit configuration. Controls how much USDC can be spent on paid tool executions per call and per day.

The platform enforces a hard cap of \$5.00 (5,000,000 atomic units) per tool call. The `max_per_call_atomic` cannot exceed this value.

**Authentication:** Requires JWT token or API key.

## Body Parameters

<ParamField body="max_per_call_atomic" type="integer" optional>
  Maximum USDC per tool call in atomic units (6 decimals). Must be between 0 and 5,000,000. Default: 5,000,000 (\$5.00).
</ParamField>

<ParamField body="daily_limit_atomic" type="integer | null" optional>
  Daily spending limit in atomic units. Set to `null` to remove the daily limit. Must be >= 0.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Settings record UUID.
</ResponseField>

<ResponseField name="user_id" type="string">
  The user's UUID.
</ResponseField>

<ResponseField name="max_per_call_atomic" type="integer">
  Updated maximum USDC per tool call in atomic units.
</ResponseField>

<ResponseField name="daily_limit_atomic" type="integer | null">
  Updated daily spending limit in atomic units.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp.
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp of the update.
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://api.danubeai.com/v1/x402/settings \
    -H "danube-api-key: dk_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "max_per_call_atomic": 2000000,
      "daily_limit_atomic": 10000000
    }'
  ```

  ```python Python SDK theme={null}
  import httpx

  resp = httpx.put(
      "https://api.danubeai.com/v1/x402/settings",
      headers={"danube-api-key": "dk_..."},
      json={
          "max_per_call_atomic": 2000000,
          "daily_limit_atomic": 10000000
      }
  )
  settings = resp.json()
  print(f"Max per call: ${settings['max_per_call_atomic'] / 1_000_000:.2f}")
  print(f"Daily limit: ${settings['daily_limit_atomic'] / 1_000_000:.2f}")
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch('https://api.danubeai.com/v1/x402/settings', {
    method: 'PUT',
    headers: {
      'danube-api-key': 'dk_your_api_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      max_per_call_atomic: 2000000,
      daily_limit_atomic: 10000000
    })
  });
  const settings = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "abc123",
    "user_id": "user-uuid",
    "max_per_call_atomic": 2000000,
    "daily_limit_atomic": 10000000,
    "created_at": "2026-02-01T00:00:00Z",
    "updated_at": "2026-02-24T12:00:00Z"
  }
  ```
</ResponseExample>

## MCP Tool

When using the Danube MCP Server, use the `update_spending_limits` tool:

```
update_spending_limits(max_per_call_usdc=2.0, daily_limit_usdc=10.0)
```

The MCP tool accepts human-readable USDC values (e.g., 2.0 = \$2.00) and converts to atomic units internally. Set `daily_limit_usdc` to 0 to remove the daily limit.
