---
title: "Create or update one rate limit rule"
method: PUT
path: "/admin/rate-limits"
tags: ["admin"]
---

# Create or update one rate limit rule

`PUT /admin/rate-limits`

## Request body

- AdminUpsertRateLimitRequest
  - `limit_key` AdminRateLimitKeyRequest
    - `period` string
    - `period_seconds` integer
  - `max_requests` integer
  - `max_tokens` integer
  - `scope` string
  - `subject` string
  - `user_path` string

## Response `200`

OK

- AdminRateLimitListResponse
  - `rate_limits` AdminRateLimitStatusResponse[]
    - `created_at` string
    - `in_flight` integer
    - `max_requests` integer
    - `max_tokens` integer
    - `period_label` string
    - `period_seconds` integer
    - `requests_remaining` integer
    - `requests_used` integer
    - `scope` string
    - `source` string
    - `subject` string
    - `tokens_remaining` integer
    - `tokens_used` integer
    - `updated_at` string
    - `user_path` string
    - `window_end` string
    - `window_start` string
  - `server_time` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `503` — Service Unavailable

---

[API](https://skmtc.net/enterpilot/apis/gomodel-api.md) · [All operations](https://skmtc.net/enterpilot/apis/gomodel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/enterpilot/gomodel-api/versions/4c27ea61fcfe/schema)
