> ## 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.

# 撤销 API Key

> 撤销所有者 Key，下一次认证即失效，历史用量记录保留。



## OpenAPI

````yaml /openapi.cn.json delete /v1/manage/keys/{id}
openapi: 3.1.0
info:
  title: OmniRelay API
  version: 1.0.0
  description: 面向已核验真实文本模型的兼容 OpenAI 网关。访问按工作空间开通，使用自己的模型列表查询能力与客户价格。
servers:
  - url: https://api.omnirelay.ai
security:
  - bearerAuth: []
tags:
  - name: 服务
  - name: 模型
  - name: 对话
  - name: 管理 API
  - name: 响应
  - name: 向量
  - name: 图片
  - name: 视频
paths:
  /v1/manage/keys/{id}:
    delete:
      tags:
        - 管理 API
      summary: 撤销 API Key
      description: 撤销所有者 Key，下一次认证即失效，历史用量记录保留。
      operationId: managementRevokeApiKey
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9-]{1,80}$
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagementOk'
              example:
                ok: true
        '400':
          description: JSON、输入、标签、模型规则、到期时间或预算规则无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized 或 management_key_required。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: insufficient_scope 或 forbidden。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: not_found：路径不存在或 Key 不属于调用者。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: rate_limited：每个管理密钥每分钟 120 次，还可能受所有者额外限流约束。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - managementAuth: []
components:
  schemas:
    ManagementOk:
      type: object
      properties:
        ok:
          type: boolean
      required:
        - ok
    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: 用于日志和 SDK 异常的简短英文说明；措辞可能调整，请按 code 判断。
            type:
              type: string
              example: not_found_error
              description: >-
                按 HTTP
                状态划分的错误类别：invalid_request_error、authentication_error、insufficient_quota、permission_error、not_found_error、conflict_error、rate_limit_error、service_unavailable
                或 api_error。
            param:
              type: string
              maxLength: 200
              description: 可识别时返回被拒绝的请求字段路径，不包含参数值；Responses 使用原生字段名。
        request_id:
          type: string
          description: 在对话补全、Responses 和 Embeddings 出错时返回。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 在 OmniRelay 控制台创建的 API Key。所有者确认身份后可在控制台再次查看。
    managementAuth:
      type: http
      scheme: bearer
      description: 在控制台创建的管理密钥；read 可读取，write 还可修改 API Key。不接受推理 API Key。

````

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