> ## Documentation Index
> Fetch the complete documentation index at: https://docs.airctrl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Update gateway settings

> Updates only the supplied spend, rate, logging, guardrail, cache or model settings. Requires gateways:manage-settings.



## OpenAPI

````yaml /api-reference/openapi.json patch /gateways/{id}/settings
openapi: 3.0.0
info:
  title: AIRCTRL API
  description: >-
    Programmatic access to AIRCTRL. Record values are encrypted by the client,
    so the API stores ciphertext and encrypted keys instead of plaintext record
    values.
  version: '1'
  contact: {}
servers:
  - url: https://api.airctrl.dev/v1
    description: Production
security: []
tags:
  - name: Context
    description: Find the accounts available to the caller.
  - name: Projects
    description: Create and manage projects.
  - name: Records
    description: Store and use client-encrypted records.
  - name: Audit
    description: Read record activity and access history.
  - name: Providers
    description: Discover supported AI providers.
  - name: Provider Credentials
    description: Manage encrypted provider credentials.
  - name: Gateways
    description: Create and operate AI gateways.
  - name: Usage
    description: Read gateway usage and spend data.
  - name: Service Accounts
    description: Read Service Account metadata and grant records.
paths:
  /gateways/{id}/settings:
    patch:
      tags:
        - Gateways
      summary: Update gateway settings
      description: >-
        Updates only the supplied spend, rate, logging, guardrail, cache or
        model settings. Requires gateways:manage-settings.
      operationId: GatewaysController_updateSettings
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGatewaySettingsDto'
      responses:
        '200':
          description: Updated gateway settings.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/GatewaySettings'
                required:
                  - ok
                  - data
                additionalProperties: false
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - personal-access-token: []
components:
  schemas:
    UpdateGatewaySettingsDto:
      type: object
      properties:
        spendLimit:
          type: number
          minimum: 0
          nullable: true
        spendWindow:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        rateLimitPerMin:
          type: integer
          minimum: 1
          nullable: true
        loggingEnabled:
          type: boolean
        logBodies:
          type: boolean
        guardrailMode:
          type: string
          enum:
            - 'off'
            - flag
            - redact
            - block
        cacheEnabled:
          type: boolean
        cacheTtlSeconds:
          type: integer
          minimum: 60
        allowedModels:
          type: array
          items:
            type: string
      additionalProperties: false
    GatewaySettings:
      type: object
      properties:
        spend_limit:
          type: string
          description: Maximum spend in US dollars.
          nullable: true
        spend_window:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        rate_limit_per_min:
          type: integer
          minimum: 1
          nullable: true
        logging_enabled:
          type: boolean
        log_bodies:
          type: boolean
        guardrail_mode:
          type: string
          enum:
            - 'off'
            - flag
            - redact
            - block
        cache_enabled:
          type: boolean
        cache_ttl_seconds:
          type: integer
          minimum: 60
        allowed_models:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
      required:
        - spend_limit
        - spend_window
        - rate_limit_per_min
        - logging_enabled
        - log_bodies
        - guardrail_mode
        - cache_enabled
        - cache_ttl_seconds
        - allowed_models
    ErrorEnvelope:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable error category.
            message:
              type: string
              description: Plain-language reason for the failure.
            details:
              description: Optional validation or error details.
          additionalProperties: false
          required:
            - code
            - message
        requestId:
          type: string
          description: Request identifier to include when contacting support.
      additionalProperties: false
      required:
        - ok
        - error
      description: Standard AIRCTRL error response.
  responses:
    BadRequest:
      description: >-
        The request is invalid. Check the body, query parameters and
        identifiers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: bad_request
              message: Request validation failed
              details:
                - Check the submitted values.
            requestId: req_example
    Unauthorized:
      description: >-
        The token is missing, invalid, expired or cannot authenticate this
        request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: unauthorized
              message: Authentication is required
            requestId: req_example
    Forbidden:
      description: >-
        The authenticated principal does not have the required permission or
        resource access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: forbidden
              message: not_authorized
            requestId: req_example
    Conflict:
      description: >-
        The request conflicts with the current resource state or reuses an
        idempotency key incorrectly.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: conflict
              message: idempotency_key_reused_with_different_params
            requestId: req_example
    RateLimited:
      description: The caller exceeded the API request limit. Wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: rate_limited
              message: Too many requests
            requestId: req_example
    InternalError:
      description: >-
        AIRCTRL could not complete the request. Retry later and keep the request
        ID for support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: internal_error
              message: Internal server error
            requestId: req_example
  securitySchemes:
    personal-access-token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Human personal access token (`sk-actrl-pat-...`).

````