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

# Authentication

> Flatpeak API uses bearer authentication to authorise access to endpoints. To create a bearer, use this endpoint with basic auth:

  | []()            | []()                                                                   
  | --------------- | ------------------------------ |
  | `username`      | Your Flatpeak Account ID.      |
  | `password`      | Any of your Flatpeak API Keys. |

<Tip>Account ID and API Keys can be found in [Dashboard](https://dashboard.flatpeak.com).</Tip>



## OpenAPI

````yaml api-reference/anode/flatpeak-api-spec-anode.json GET /login
openapi: 3.0.3
info:
  description: Flatpeak API
  version: 2025-09-14.anode
  title: Flatpeak API
  termsOfService: https://flatpeak.com/legal
  contact:
    name: Technical Support
    email: support@flatpeak.com
    url: https://flatpeak.com/contact
  license:
    name: Apache 2.0
    url: https://flatpeak.com/legal
servers:
  - url: https://api.flatpeak.com
    description: Location
security: []
tags:
  - name: Consumption
    description: Consumption operations
  - name: Customers
    description: Customer operations
  - name: Devices
    description: Device operations
  - name: Meters
    description: Meter readings operations
  - name: Events
    description: Events operations
  - name: Login
    description: Bearer auth token operations
  - name: Connect
    description: Connect operations
  - name: Locations
    description: Location operations
  - name: Rates
    description: Rates operations
  - name: Costs
    description: Consumption cost calculations
  - name: Schedules
    description: Consumption schedules
  - name: Tariffs
    description: Tariff operations
  - name: Slots
    description: Slots operations
externalDocs:
  description: Location documentation
  url: https://docs.flatpeak.com
paths:
  /login:
    parameters: []
    get:
      tags:
        - Login
      summary: Authentication
      description: >-
        Flatpeak API uses bearer authentication to authorise access to
        endpoints. To create a bearer, use this endpoint with basic auth:

          | []()            | []()                                                                   
          | --------------- | ------------------------------ |
          | `username`      | Your Flatpeak Account ID.      |
          | `password`      | Any of your Flatpeak API Keys. |

        <Tip>Account ID and API Keys can be found in
        [Dashboard](https://dashboard.flatpeak.com).</Tip>
      operationId: bearer-token
      responses:
        '200':
          $ref: '#/components/responses/AuthToken'
        '201':
          description: Created
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
      security:
        - basicAuth: []
components:
  responses:
    '403':
      description: 403 forbidden
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Bad credentials
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: gria4ysjd9zhk
                default: error
              type:
                type: string
                x-stoplight:
                  id: 7mhtfljidnqcu
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: sy7ljpdy5wdes
                example: access_denied
                default: access_denied
              time_created:
                type: string
                x-stoplight:
                  id: 84d5biv9dfbc9
                format: date-time
                example: '2025-01-01T00:00:00Z'
            required:
              - object
              - type
              - code
          examples: {}
    '429':
      description: 429 Too many requests
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                x-stoplight:
                  id: irkmp11gg6sjx
                example: error
                default: error
              type:
                type: string
                x-stoplight:
                  id: u0gq12cizam3d
                default: rate_limit
                example: rate_limit
              code:
                type: string
                x-stoplight:
                  id: uh7x9404d4w3q
                default: too_many_requests
                example: too_many_requests
              message:
                type: string
                x-stoplight:
                  id: 9z8h79l1coblc
                default: Too many requests. Please retry after a short delay.
                example: Too many requests. Please retry after a short delay.
              time_created:
                type: string
                x-stoplight:
                  id: ea7o3uvdojrtc
                format: date-time
                default: '2026-01-29T17:11:52Z'
                example: '2026-01-29T17:11:52Z'
            required:
              - object
              - type
              - code
              - message
    AuthToken:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthToken'
  schemas:
    AuthToken:
      type: object
      x-examples: {}
      properties:
        bearer_token:
          type: string
          description: The bearer security token.
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiYWNjXzQwODQzYzgwNThlMzRiM2E5OGZkMGY1Yjc1MmE2OTFiIiwibGl2ZV9tb2RlIjpmYWxzZSwiaXNzIjoiRmxhdFBlYWtBUEkiLCJzdWIiOiJhY2NfNDA4NDNjODA1OGUzNGIzYTk4ZmQwZjViNzUyYTY5MWIiLCJleHAiOjE2NjYwOTg4NjgsIm5iZiI6MTY2NjAxMjQ2OCwiaWF0IjoxNjY2MDEyNDY4fQ.GVfkaouHm4nBoj5gSaAaEBaoS9tPNhALgrMu0-TIrWQ
        expires_in:
          type: integer
          description: Expiration time in seconds.
          example: 3600
        live_mode:
          type: boolean
          description: >-
            Has the value `true` if the object exists in live mode or the value
            `false` if the object exists in test mode.
          example: true
          x-stoplight:
            id: 3ksj2ou6nmtwg
      required:
        - bearer_token
        - expires_in
        - live_mode
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Pass your `account_id` as username and `secret_key` as password via
        basic auth.

````