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

# Exchange API Key for JWT

> Exchange your API Key for a JWT access token.



## OpenAPI

````yaml /en/openapi/tcbs-v1.yaml post /gaia/v1/oauth2/openapi/token
openapi: 3.0.3
info:
  title: TCBS iFlash Open API
  description: REST APIs for trading stocks and derivatives on TCBS.
  version: 1.0.0
  contact:
    email: openapi@tcbs.com.vn
servers:
  - url: https://openapi.tcbs.com.vn
    description: Production
security:
  - bearerAuth: []
paths:
  /gaia/v1/oauth2/openapi/token:
    post:
      summary: Exchange API Key for JWT
      description: Exchange your API Key for a JWT access token.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                apiKey:
                  type: string
                  description: API Key generated on TCInvest.
                otp:
                  type: string
                  description: OTP code from TCInvest app.
                otpId:
                  type: string
                  description: OTP ID returned from Step 1.
              required:
                - apiKey
                - otp
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: JWT token for subsequent requests.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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