# The agent key budget does not cover this spend

> agent-budget-exceeded: HTTP 403. Keep the machine quote_id and ask the key owner to approve it at approval_url, or top up at top_up_url.

Source: https://emailmovers.com/mydatahub/docs/errors/agent-budget-exceeded

`agent-budget-exceeded` is returned with HTTP status 403. Its type URI is `https://emailmovers.com/mydatahub/docs/errors/agent-budget-exceeded`.

## What it means

An agent key's per-order cap or monthly budget does not cover the spend. No order was created. The key owner is told only when the key has a webhook_url and an endpoint is registered at that exact URL, so the notice can be signed.

The limits are checked before the balance, so an agent over its cap sees this even when the balance is also short.

## What to do

Keep the machine quote_id and ask the key owner to approve it at approval_url, or top up at top_up_url.

## Members it adds

Beyond `type`, `title`, `status`, `detail`, `code` and `next_step`, this problem carries `budget`, `per_order_max_credits`, `quote_id`, `credits_required`, `approval_url` and `top_up_url`. They are published in the `AgentBudgetProblem` schema of the OpenAPI document.

## Example

```json
{
  "type": "https://emailmovers.com/mydatahub/docs/errors/agent-budget-exceeded",
  "title": "The agent key budget does not cover this spend",
  "status": 403,
  "code": "agent-budget-exceeded",
  "detail": "The order needs 5,000 credits and the key has 800 left this month.",
  "next_step": "Keep the machine quote_id and ask the key owner to approve it at approval_url, or top up at top_up_url.",
  "budget": {
    "monthly_credits": 1000,
    "spent": 200,
    "remaining": 800,
    "resets_at": "2026-10-01T00:00:00Z"
  },
  "per_order_max_credits": 500,
  "quote_id": "qte_01JB4M2R6T1Y5W8ZAK8Q2V7XN3",
  "credits_required": 5000,
  "approval_url": "https://mydatahub.emailmovers.com/quotes/qte_01JB4M2R6T1Y5W8ZAK8Q2V7XN3/approve",
  "top_up_url": "https://mydatahub.emailmovers.com/billing/top-up"
}
```

## See also

- [Spending safely](https://emailmovers.com/mydatahub/docs/spending-safely.md)
- [Authentication](https://emailmovers.com/mydatahub/docs/authentication.md)

All problem types are listed on [Errors](https://emailmovers.com/mydatahub/docs/errors.md).
