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

# Exchange an API key for an access token

> Exchange a public API key for a bearer token.



## OpenAPI

````yaml /openapi.json post /v1/auth/token
openapi: 3.1.0
info:
  title: Passu Public API
  summary: >-
    External read-only API for sectors, companies, events, metrics, and
    analyses.
  description: >-
    The Passu Public API is a read-only external API intended for
    server-to-server integrations.
  version: v1
servers:
  - url: https://api.passu.ai
    description: Production
security: []
tags:
  - name: auth
  - name: sectors
  - name: companies
  - name: events
  - name: metrics
  - name: analyses
paths:
  /v1/auth/token:
    post:
      tags:
        - auth
      summary: Exchange an API key for an access token
      description: Exchange a public API key for a bearer token.
      operationId: exchangeAccessToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenExchangeRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenExchangeResponse'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        '503':
          description: Authentication service unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
components:
  schemas:
    TokenExchangeRequest:
      properties:
        client_id:
          type: string
          maxLength: 255
          minLength: 1
          title: Client Id
        client_secret:
          type: string
          maxLength: 255
          minLength: 1
          title: Client Secret
      type: object
      required:
        - client_id
        - client_secret
      title: TokenExchangeRequest
    TokenExchangeResponse:
      properties:
        access_token:
          type: string
          title: Access Token
        token_type:
          type: string
          title: Token Type
        expires_in:
          type: integer
          title: Expires In
      type: object
      required:
        - access_token
        - token_type
        - expires_in
      title: TokenExchangeResponse
    Problem:
      properties:
        type:
          type: string
          title: Type
        title:
          type: string
          title: Title
        status:
          type: integer
          title: Status
        detail:
          type: string
          title: Detail
        request_id:
          type: string
          title: Request Id
        instance:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance
        errors:
          anyOf:
            - items:
                $ref: '#/components/schemas/ValidationErrorItem'
              type: array
            - type: 'null'
          title: Errors
      type: object
      required:
        - type
        - title
        - status
        - detail
        - request_id
      title: Problem
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationErrorItem:
      properties:
        field:
          type: string
          title: Field
        message:
          type: string
          title: Message
      type: object
      required:
        - field
        - message
      title: ValidationErrorItem
    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

````