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

# Delete Key

> Delete an API key. Requires scope: keys:delete

<Warning>
  Deleting a key is permanent. Any application using it will immediately lose API access. Rotate to a new key before deleting the old one.
</Warning>

<Note>
  For a detailed walkthrough with examples, see the [API Key Management guide](/account-management/api-key-management).
</Note>


## OpenAPI

````yaml DELETE /v1/account/keys/{key_id}
openapi: 3.1.0
info:
  title: Routeway API
  version: 1.0.0
servers:
  - url: https://api.routeway.ai
security:
  - HTTPBearer: []
paths:
  /v1/account/keys/{key_id}:
    delete:
      tags:
        - Account & Keys
      summary: Delete API Key
      description: 'Delete an API key. Requires scope: keys:delete'
      operationId: delete_key_v1_account_keys__key_id__delete
      parameters:
        - name: key_id
          in: path
          required: true
          schema:
            type: integer
            title: Key Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountKeyDeleteResponse'
        '400':
          description: Bad Request - Deletion failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - You do not own this API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - API key not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AccountKeyDeleteResponse:
      properties:
        message:
          type: string
          title: Message
          description: Success message.
          default: API key successfully deleted.
      type: object
      title: AccountKeyDeleteResponse
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: A human-readable description of the error.
        type:
          type: string
          title: Type
          description: >-
            The type of error returned (e.g. invalid_request_error,
            rate_limit_error).
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The parameter that caused the error, if applicable.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            A short code identifier for the error type (e.g. invalid_request,
            rate_limit).
        status_code:
          type: integer
          title: Status Code
          description: The HTTP status code.
        id:
          type: string
          title: Id
          description: Unique error or trace ID associated with this request.
        tip:
          anyOf:
            - type: string
            - type: 'null'
          title: Tip
          description: An optional troubleshooting tip or resolution suggestion.
        docs:
          anyOf:
            - type: string
            - type: 'null'
          title: Docs
          description: Link to the documentation related to this error.
          default: https://docs.routeway.ai
        support:
          anyOf:
            - type: string
            - type: 'null'
          title: Support
          description: Link to support for further help.
          default: https://discord.gg/RjX2CpdPpd
        community:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Community
          description: Links to community resources like Discord and Twitter.
      type: object
      required:
        - message
        - type
        - status_code
        - id
      title: ErrorDetail
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````