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

# Revoke a customer key

> Revoke one of the customer's keys. Requests made with it are rejected immediately; usage already recorded stays attributed to the customer. Idempotent: revoking an already-revoked key answers 200 with the original `revoked_at`. A key that does not belong to this customer (or to your organization) is `404`.



## OpenAPI

````yaml /api-reference/openapi.json delete /v1/customers/{customerId}/keys/{keyId}
openapi: 3.0.3
info:
  title: AI Reserve Gateway API
  description: >-
    The AI Reserve API surface — OpenAI-compatible chat completions,
    Anthropic-compatible messages, Bedrock Converse, images, video, files,
    text-to-speech, realtime voice sessions, and provider-hidden GPU
    infrastructure — all behind one endpoint and one API key.
  version: 1.0.0
servers:
  - url: https://api.aireserve.com
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: >-
      Per-end-customer usage, cost, and billable amounts for organizations that
      tag requests with their own customers.
  - name: GPU Infrastructure
    description: >-
      Provision and manage provider-hidden GPU instances. The recommended
      Instances API accepts workload requirements and an hourly price ceiling;
      AI Reserve handles provider placement internally. Every mutation is
      asynchronous and returns an operation to poll.
  - name: Customer keys
    description: >-
      Mint, list, and revoke API keys pinned to your own end customers (and
      their organizations), so spend splits per customer without per-request
      tagging.
paths:
  /v1/customers/{customerId}/keys/{keyId}:
    delete:
      tags:
        - Customer keys
      summary: Revoke a customer key
      description: >-
        Revoke one of the customer's keys. Requests made with it are rejected
        immediately; usage already recorded stays attributed to the customer.
        Idempotent: revoking an already-revoked key answers 200 with the
        original `revoked_at`. A key that does not belong to this customer (or
        to your organization) is `404`.
      operationId: revokeCustomerKey
      parameters:
        - name: customerId
          in: path
          required: true
          description: >-
            Your end-customer id, URL-encoded — the same opaque id you would
            otherwise send as `x-aireserve-customer` (1–128 printable
            characters).
          schema:
            type: string
            minLength: 1
            maxLength: 128
        - name: keyId
          in: path
          required: true
          description: The key's `id` from the create or list response.
          schema:
            format: uuid
            type: string
      responses:
        '200':
          description: Key revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokedCustomerKey'
        '400':
          description: Malformed customer id, key id, or request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerKeyError'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerKeyError'
        '403':
          description: >-
            The key is valid but may not manage customers: customer keys, team
            keys, and personal keys are refused (use an organization-level key),
            or a screen (IP allowlist, country, suspension) rejected the
            request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerKeyError'
        '404':
          description: No key with this id exists for this customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerKeyError'
        '429':
          description: Per-organization rate limit exceeded. Honor `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerKeyError'
      security:
        - bearerAuth: []
components:
  schemas:
    RevokedCustomerKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        customer_id:
          type: string
        org_id:
          nullable: true
          type: string
        status:
          type: string
          enum:
            - revoked
        revoked_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
      required:
        - id
        - customer_id
        - org_id
        - status
        - revoked_at
      additionalProperties: false
    CustomerKeyError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              nullable: true
              type: string
            code:
              type: string
          required:
            - message
            - type
            - param
            - code
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your AI Reserve API key (aireserve_api_…) from the API Keys page in the
        portal (https://portal.aireserve.com/keys).

````

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