# Replace rate

URL: https://docs.hanzo.ai/docs/openapi/ai/aisetratelimit

> Sets the model requests one person may make in a minute acting in the organization the caller acts in, on every surface: 1 up to the platform's default, never more, or 0 to hold its people to the default.

`PUT /v1/ai/limits/rate`

> [AI →](https://docs.hanzo.ai/docs/openapi/ai) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                          |
| ------------- | ---------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/ai/limits/rate` |
| **Method**    | `PUT`                                    |
| **Operation** | `aiSetRateLimit`                         |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`   |

Sets the model requests one person may make in a minute acting in the
organization the caller acts in, on every surface: 1 up to the platform's
default, never more, or 0 to hold its people to the default. An owner or admin of
the organization, or a SuperAdmin, may; a member may not, and a shared sign-up
org, which has no admin to speak for its people, is refused. A change a page made
with the caller's cookie, not the caller (cloud.CSRF), is refused (403). Live at
once for every model request. On the audit trail before the write (ai.limits.rate.attempt)
and with its outcome (ai.limits.rate), the setting before and after; a trail that
does not take the attempt refuses the change (503), and nothing moves.

## Request

1 field, body `application/json` (required).

| Field | In   | Type            | Required | Description                                                                                                                                                   |
| ----- | ---- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rpm` | body | integer (int64) | —        | Rpm is the model requests one person may make in a minute acting in the organization: 1 up to the platform's default, or 0 to hold its people to the default. |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | aiRate          | ok      |
| `default` | problem-details | refused |

`200` body — 4 fields.

| Field     | In   | Type            | Always | Description                                                                                                                                    |
| --------- | ---- | --------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `default` | body | integer (int64) | —      | Default is the platform's requests a minute, the most the organization may set.                                                                |
| `org`     | body | string          | —      | Org is the organization.                                                                                                                       |
| `own`     | body | integer (int64) | —      | Own is the organization's own setting, 0 when it holds its people to the default.                                                              |
| `rpm`     | body | integer (int64) | —      | Rpm is the model requests a minute one person may make acting in it now: its own setting where it set less than the default, else the default. |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo ai limits rate replace
```

**SDK**

**.ts**

```ts
import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.aiSetRateLimit({ rpm: 0 });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AiApi(client).ai_set_rate_limit(rpm=0)
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.AiSetRateLimit(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, ai_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ai_api::ai_set_rate_limit(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AiApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AiApi(client).aiSetRateLimit();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (npm) and `hanzoai@8.5.914` (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/ai/limits/rate \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "rpm": 0
     }'
```

**MCP**

MCP declares no tool for **ai** — `tools/list` on `https://api.hanzo.ai/v1/mcp` names the products it does reach. Use HTTP or an SDK.

---

[AI API](https://docs.hanzo.ai/docs/openapi/ai) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
