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

# Rotate API key

> Rotates an active owner key; preserves ID, restrictions, expiry and spending counters. The old credential stops working; the new key is returned once. Limited to 10 rotations per owner per hour.



## OpenAPI

````yaml /openapi.json post /v1/manage/keys/{id}/rotate
openapi: 3.1.0
info:
  title: OmniRelay API
  version: 1.0.0
  description: >-
    OpenAI-compatible gateway for reviewed real text models. Access is
    workspace-specific; query your own model list for capabilities and customer
    prices.
servers:
  - url: https://api.omnirelay.ai
security:
  - bearerAuth: []
tags:
  - name: Service
  - name: Models
  - name: Chat
  - name: Management
  - name: Responses
  - name: Embeddings
  - name: Images
  - name: Videos
paths:
  /v1/manage/keys/{id}/rotate:
    post:
      tags:
        - Management
      summary: Rotate API key
      description: >-
        Rotates an active owner key; preserves ID, restrictions, expiry and
        spending counters. The old credential stops working; the new key is
        returned once. Limited to 10 rotations per owner per hour.
      operationId: managementRotateApiKey
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9-]{1,80}$
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagementCreatedKey'
              example:
                id: example-key-id
                key: or-live-…
        '400':
          description: Invalid JSON, input, tags, model rules, expiry or budget policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized or management_key_required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: insufficient_scope or forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 'not_found: unknown route or key not owned by the caller.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            key_changed: concurrent modification; fetch current state before
            deciding to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: 'payload_too_large: HTTP body exceeds 16000 characters.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            rate_limited: 120 requests per management key per minute; additional
            owner limits may apply.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - managementAuth: []
components:
  schemas:
    ManagementCreatedKey:
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        expiresAt:
          type: integer
          nullable: true
      required:
        - id
        - key
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - type
          properties:
            code:
              type: string
              example: model_unavailable
            message:
              type: string
              example: The model does not exist or is disabled.
              description: >-
                Short English description for logs and SDK exceptions. Its
                wording can change; branch on code.
            type:
              type: string
              example: not_found_error
              description: >-
                Error family by HTTP status: invalid_request_error,
                authentication_error, insufficient_quota, permission_error,
                not_found_error, conflict_error, rate_limit_error,
                service_unavailable or api_error.
            param:
              type: string
              maxLength: 200
              description: >-
                Rejected request field path when identifiable; never a parameter
                value. Responses uses native field names.
        request_id:
          type: string
          description: Present on chat completion, Responses and embeddings errors.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key created in the OmniRelay console. The owner can view it again
        in the console after confirming their identity.
    managementAuth:
      type: http
      scheme: bearer
      description: >-
        Management key created in the console. read scope reads; write scope
        also changes API keys. Inference API keys are not accepted.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.