---
title: Plan upgrades with AI
description: Upgrade a hosting plan from your AI tool in two steps — options, the exact price, and confirmation with a phrase you type yourself
sidebar:
  order: 19.9
  badge:
    text: Alpha
    variant: tip
---

When a site has outgrown its plan (disk full, addon-domain or mailbox limit reached, a build running out of memory), your AI tool can suggest a higher plan and place the upgrade with your confirmation. Tools such as [`hosting_resource_usage`](/en/ai-mcp/hosting/), [`hosting_site_doctor`](/en/ai-mcp/hosting/#site-doctor) and the `plan_limit_reached` error usually lead here.

## The upgrade rule

The same rule as the Hostino panel:

- **Same product group:** the same hosting type (Linux, WordPress, Node.js…) and the same location (Iran or Europe).
- **Higher plans only:** a plan whose price for **this service's own billing cycle** is higher. No downgrades.
- **The billing cycle stays the same:** a monthly service stays monthly.
- **Not included:** email hosting and one-click apps (upgraded in the panel). Changing location or hosting type is a migration; contact support.
- The service must be **active**.

## The two-step flow

| Step | Tool | Scope | What happens |
|---|---|---|---|
| 0 | `service_upgrade_options` | `services:read` | Allowed plans with the price per period; read-only |
| 1 | `service_upgrade` | `orders:write` | The exact **prorated** amount (for the days left in the current period, with estimated VAT) and a **confirmation phrase**; nothing changes yet |
| 2 | `service_upgrade_confirm` | `orders:write` + `orders:confirm` | With the phrase **you** typed, the upgrade order and an **unpaid invoice** are created |
| 3 | `prepare_invoice_payment` → `pay_invoice_with_credit` | `orders:confirm` + `billing:pay` | Pay the invoice from credit with a second phrase, or pay it in the panel |

**The plan switches when the invoice is paid** — automatically, without downtime.

Example confirmation phrase:

```text
confirm upgrading example.com to WP-Core-IR 286,000 toman code 4821
```

- The phrase is accepted with Persian or English digits, with or without thousands separators, is valid for about 15 minutes and locks after 5 wrong attempts.
- The tool must **never** type or complete the phrase itself.
- **The amount is re-checked at confirmation.** The prorated amount moves with the calendar; if it changed between steps 1 and 2, the answer is `amount_changed` with the new amount and phrase, and you confirm again.
- `orders:confirm` is not allowed in [API tokens](/en/ai-mcp/authentication/#api-tokens-personal-access-tokens), so **confirming an upgrade is never possible with an API token** — only through an OAuth connection, typed by the account owner.
- At most 3 upgrades per account in 24 hours.

## An example conversation

1. "My hosting is full; what should I do?" The tool sees with `hosting_resource_usage` that the disk is 96% full and shows the higher plans with their monthly price via `service_upgrade_options`.
2. "I'll take WP-Pro." The tool calls `service_upgrade` and shows the prorated amount and the confirmation phrase.
3. You type the phrase → `service_upgrade_confirm` issues the invoice.
4. "Pay it from my credit." → `prepare_invoice_payment` gives the exact amount and a second phrase; once you type it, the invoice is paid and the plan switches automatically.

## Errors

| Code | Cause |
|---|---|
| `not_upgradable_here` | Email, one-click app, or a service without a regular billing cycle; use the panel or support |
| `upgrade_not_allowed` | `plan_id` is not among the `service_upgrade_options` |
| `service_not_active` / `service_not_found` | The service is not active or not yours |
| `amount_changed` | The prorated amount changed; the new phrase is in `new_request` |
| `confirmation_mismatch` | The typed phrase is wrong (`attempts_left`) |
| `request_expired` | Expired; call `service_upgrade` again |
| `too_many_attempts` / `daily_limit_reached` | Too many attempts or the daily limit |
| `amount_over_limit` | The amount is above the limit for this route; upgrade in the panel |

REST equivalent: [Purchases API → Plan upgrades](/en/api/purchases/#plan-upgrades).
