> ## Documentation Index
> Fetch the complete documentation index at: https://gomodel-feat-mcp-server.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or update one rate limit rule



## OpenAPI

````yaml /openapi.json put /admin/rate-limits
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, OpenRouter, DeepSeek, Z.ai, xAI, MiniMax, Xiaomi
    MiMo, OpenCode Go, Oracle, Ollama, Bailian). Drop-in OpenAI-compatible API.
  title: GoModel API
  contact: {}
  version: '1.0'
servers:
  - url: '{base_url}'
    description: Edit the base URL to point at your GoModel deployment.
    variables:
      base_url:
        default: http://localhost:8080
        description: Your GoModel deployment URL
security: []
paths:
  /admin/rate-limits:
    put:
      tags:
        - admin
      summary: Create or update one rate limit rule
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/admin.upsertRateLimitRequest'
        description: Rate limit key and limits
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/admin.rateLimitListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.GatewayError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.GatewayError'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.GatewayError'
      security:
        - BearerAuth: []
components:
  schemas:
    admin.upsertRateLimitRequest:
      type: object
      properties:
        limit_key:
          $ref: '#/components/schemas/admin.rateLimitKeyRequest'
        max_requests:
          type: integer
        max_tokens:
          type: integer
        scope:
          type: string
        subject:
          type: string
        user_path:
          type: string
    admin.rateLimitListResponse:
      type: object
      properties:
        rate_limits:
          type: array
          items:
            $ref: '#/components/schemas/admin.rateLimitStatusResponse'
        server_time:
          type: string
    core.GatewayError:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
        param:
          type: string
          nullable: true
        provider:
          type: string
        status_code:
          type: integer
        type:
          $ref: '#/components/schemas/core.ErrorType'
    admin.rateLimitKeyRequest:
      type: object
      properties:
        period:
          type: string
        period_seconds:
          type: integer
    admin.rateLimitStatusResponse:
      type: object
      properties:
        created_at:
          type: string
        in_flight:
          type: integer
        max_requests:
          type: integer
        max_tokens:
          type: integer
        period_label:
          type: string
        period_seconds:
          type: integer
        requests_remaining:
          type: integer
        requests_used:
          type: integer
        scope:
          type: string
        source:
          type: string
        subject:
          type: string
        tokens_remaining:
          type: integer
        tokens_used:
          type: integer
        updated_at:
          type: string
        user_path:
          type: string
        window_end:
          type: string
        window_start:
          type: string
    core.ErrorType:
      type: string
      enum:
        - provider_error
        - rate_limit_error
        - invalid_request_error
        - authentication_error
        - not_found_error
      x-enum-varnames:
        - ErrorTypeProvider
        - ErrorTypeRateLimit
        - ErrorTypeInvalidRequest
        - ErrorTypeAuthentication
        - ErrorTypeNotFound
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````