# 获取TikHub用户信息/Get TikHub user info

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/tikhub/user/get_user_info:
    get:
      summary: 获取TikHub用户信息/Get TikHub user info
      deprecated: false
      description: >-
        # [中文]

        ### 用途:

        - 请求头中携带API Key请求此端点可以查询当前账户信息。

        ### 参数:

        - 请求头：{'Authorization': 'Bearer API_KEY'}

        ### 返回:

        - 用户信息


        # [English]

        ### Purpose:

        - Request this endpoint with API Key in the header to query the current
        account information.

        ### Parameters:

        - Headers: {'Authorization': 'Bearer API_KEY'}

        ### Return:

        - User information


        # [示例/Example]

        ```python

        response = {
              "code": 200,
              "router": "/api/v1/tikhub/user/get_user_info",
              "api_key_data": {
                "api_key_name": "Develop Test",
                "api_key_scopes": [
                  "/api/v1/tikhub/user/"
                ],
                "created_at": "2024-05-22T06:07:12.495520",
                "expires_at": null,
                "api_key_status": 1
              },
              "user_data": {
                "email": "example@example.com",
                "balance": 100,
                "free_credit": 100,
                "email_verified": true,
                "account_disabled": false,
                "is_active": true
              }
            }
        ```
      operationId: get_user_info_api_v1_tikhub_user_get_user_info_get
      tags:
        - TikHub-User-API
        - TikHub-User-API
      parameters: []
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfoResponseModel'
          headers: {}
          x-apifox-name: OK
      security:
        - HTTPBearer: []
          x-apifox:
            schemeGroups:
              - id: aPIJWNqfXM8i82j3kLjbF
                schemeIds:
                  - HTTPBearer
            required: true
            use:
              id: aPIJWNqfXM8i82j3kLjbF
            scopes:
              aPIJWNqfXM8i82j3kLjbF:
                HTTPBearer: []
      x-apifox-folder: TikHub-User-API
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4705614/apis/api-186826050-run
components:
  schemas:
    UserInfoResponseModel:
      properties:
        code:
          type: integer
          title: Code
          description: HTTP status code | HTTP状态码
          default: 200
        router:
          type: string
          title: Router
          description: The endpoint that generated this response | 生成此响应的端点
          default: ''
        api_key_data:
          $ref: '#/components/schemas/APIKeyData'
        user_data:
          $ref: '#/components/schemas/UserData'
      type: object
      required:
        - api_key_data
        - user_data
      title: UserInfoResponseModel
      x-apifox-orders:
        - code
        - router
        - api_key_data
        - user_data
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    UserData:
      properties:
        email:
          type: string
          title: Email
        balance:
          type: number
          title: Balance
        free_credit:
          type: number
          title: Free Credit
        email_verified:
          type: boolean
          title: Email Verified
        account_disabled:
          type: boolean
          title: Account Disabled
        is_active:
          type: boolean
          title: Is Active
      type: object
      required:
        - email
        - balance
        - free_credit
        - email_verified
        - account_disabled
        - is_active
      title: UserData
      x-apifox-orders:
        - email
        - balance
        - free_credit
        - email_verified
        - account_disabled
        - is_active
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    APIKeyData:
      properties:
        api_key_name:
          type: string
          title: Api Key Name
        api_key_scopes:
          items:
            type: string
          type: array
          title: Api Key Scopes
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        api_key_status:
          type: integer
          title: Api Key Status
      type: object
      required:
        - api_key_name
        - api_key_scopes
        - created_at
        - expires_at
        - api_key_status
      title: APIKeyData
      x-apifox-orders:
        - api_key_name
        - api_key_scopes
        - created_at
        - expires_at
        - api_key_status
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    HTTPBearer:
      type: bearer
      description: >
        ----

        #### API Token Introduction:

        ##### Method 1: Use API Token in the Request Header (Recommended)

        - **Header**: `Authorization`

        - **Format**: `Bearer {token}`

        - **Example**: `{"Authorization": "Bearer your_token"}`

        - **Swagger UI**: Click on the `Authorize` button in the upper right
        corner of the page to enter the API token directly without the `Bearer`
        keyword.


        ##### Method 2: Use API Token in the Cookie (Not Recommended, Use Only
        When Method 1 is Unavailable)

        - **Cookie**: `Authorization`

        - **Format**: `Bearer {token}`

        - **Example**: `Authorization=Bearer your_token`


        #### Get API Token:

        1. Register and log in to your account on the TikHub website.

        2. Go to the user center, click on the API token menu, and create an API
        token.

        3. Copy and use the API token in the request header.

        4. Keep your API token confidential and use it only in the request
        header.


        ----


        #### API令牌简介:

        ##### 方法一：在请求头中使用API令牌（推荐）

        - **请求头**: `Authorization`

        - **格式**: `Bearer {token}`

        - **示例**: `{"Authorization": "Bearer your_token"}`

        - **Swagger UI**: 点击页面右上角的`Authorize`按钮，直接输入API令牌，不需要`Bearer`关键字。


        ##### 方法二：在Cookie中使用API令牌（不推荐，仅在无法使用方法一时使用）

        - **Cookie**: `Authorization`

        - **格式**: `Bearer {token}`

        - **示例**: `Authorization=Bearer your_token`


        #### 获取API令牌:

        1. 在TikHub网站注册并登录账户。

        2. 进入用户中心，点击API令牌菜单，创建API令牌。

        3. 复制并在请求头中使用API令牌。

        4. 保密您的API令牌，仅在请求头中使用。
      scheme: bearer
servers:
  - url: https://api.tikhub.io
    description: Production Environment
security: []

```
