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

# Получить баланс

> Возвращает профиль и баланс владельца ключа. Передайте ключ в заголовке x-api-key. Необязательный query username не подменяет партнёра: в ответе всегда владелец ключа. balance — число, округлённое до двух знаков. api_key — ключ из заголовка.



## OpenAPI

````yaml /openapi.json get /user/balance
openapi: 3.0.0
info:
  title: BitRangers API
  description: >-
    Партнёрское API BitRangers: заявки, баланс, курсы, Premium Exchanger и
    Legacy.
  version: '1.0'
servers:
  - url: https://api.bitrangers.space
security: []
paths:
  /user/balance:
    get:
      tags:
        - legacy
      summary: Получить баланс
      description: >-
        Возвращает профиль и баланс владельца ключа. Передайте ключ в заголовке
        x-api-key. Необязательный query username не подменяет партнёра: в ответе
        всегда владелец ключа. balance — число, округлённое до двух знаков.
        api_key — ключ из заголовка.
      operationId: getLegacyBalance
      parameters:
        - name: username
          required: false
          in: query
          description: 'Для партнёра не меняет ответ: данные возвращаются по ключу.'
          schema:
            example: partner1
            type: string
      responses:
        '200':
          description: Профиль и баланс.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  username:
                    type: string
                  role:
                    type: string
                  twofa_enabled:
                    type: boolean
                  api_key:
                    type: string
                    nullable: true
                  balance:
                    type: number
              example:
                id: 8f1c0b2e-6a4d-4e1a-9c3b-2d5e7f8a9b01
                username: partner1
                role: partner
                twofa_enabled: true
                api_key: br_live_example
                balance: 10000
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Ключ партнёра. Передайте его в заголовке x-api-key.
      x-default: br_live_example

````

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