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

# Get an access token

> Exchange your API key for a short lived access token. Send the token as the bearer on every other call.



## OpenAPI

````yaml /api-reference/openapi.yaml post /token
openapi: 3.1.0
info:
  title: Skye Flights API
  version: '1.0'
  description: Search and book real flights for your users. Skye is the Merchant of Record.
servers:
  - url: https://api.flyskye.ai/v1
security:
  - accessToken: []
tags:
  - name: Authentication
  - name: Flights
  - name: Booking sessions
  - name: Payments
  - name: Bookings
paths:
  /token:
    post:
      tags:
        - Authentication
      summary: Get an access token
      description: >-
        Exchange your API key for a short lived access token. Send the token as
        the bearer on every other call.
      responses:
        '200':
          description: An access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - apiKey: []
components:
  schemas:
    Token:
      type: object
      properties:
        access_token:
          type: string
          example: sat_...
        token_type:
          type: string
          example: Bearer
        expires_in:
          type: integer
          example: 3600
        expires_at:
          type: string
          format: date-time
        mode:
          type: string
          enum:
            - live
            - test
        scope:
          type: string
          example: search book
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
              example: departDate cannot be in the past
            field:
              type: string
              example: departDate
  responses:
    Unauthorized:
      description: Missing, invalid or expired key or token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: An access token (`sat_...`) from `POST /token`.
    apiKey:
      type: http
      scheme: bearer
      description: Your API key, `pk_test_...` or `pk_live_...`. Only for `/token`.

````

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