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

# Log out the current session

> Revoke the caller's session by fanning ``revoke_session`` out over every
presented credential candidate and every registered accounts provider.

Iterating all candidates is required: a client may present a stale value in
``Authorization`` alongside its live session in ``X-Api-Key``, so checking only the
first would leave that session alive. The FIRST ``True`` → ``{"revoked": true}``.
Only when EVERY candidate against EVERY provider returns ``False`` → 404 (an
``sk-`` API key cannot "log out" — loud, not a silent no-op), with a server-side
log naming the caller so probing/replay stays visible. Provider errors propagate
(fail closed).



## OpenAPI

````yaml /openapi.json post /api/auth/logout
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 0.1.1
servers: []
security: []
paths:
  /api/auth/logout:
    post:
      tags:
        - access-control
      summary: Log out the current session
      description: >-
        Revoke the caller's session by fanning ``revoke_session`` out over every

        presented credential candidate and every registered accounts provider.


        Iterating all candidates is required: a client may present a stale value
        in

        ``Authorization`` alongside its live session in ``X-Api-Key``, so
        checking only the

        first would leave that session alive. The FIRST ``True`` → ``{"revoked":
        true}``.

        Only when EVERY candidate against EVERY provider returns ``False`` → 404
        (an

        ``sk-`` API key cannot "log out" — loud, not a silent no-op), with a
        server-side

        log naming the caller so probing/replay stays visible. Provider errors
        propagate

        (fail closed).
      operationId: post_api_auth_logout
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````