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

# Generate JWT Token

> Generates a JWT token with 1 RPS rate limiting for a given user address



## OpenAPI

````yaml /kuru-flow/openapi.json post /api/generate-token
openapi: 3.0.3
info:
  title: Kuru WebSocket API
  description: >-
    API for Kuru WebSocket services including JWT token generation and swap
    quote calculations
  version: 1.0.0
servers:
  - url: https://ws.kuru.io
    description: Main server
security: []
paths:
  /api/generate-token:
    post:
      summary: Generate JWT Token
      description: Generates a JWT token with 1 RPS rate limiting for a given user address
      operationId: generateToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenGenerationRequest'
            example:
              user_address: '0x1234567890abcdef1234567890abcdef12345678'
      responses:
        '200':
          description: Successfully generated JWT token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenGenerationResponse'
              example:
                token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                expires_at: 1700000000
                rate_limit:
                  rps: 1
                  burst: 1
        '400':
          description: Bad Request - Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_json:
                  value:
                    error: invalid_json
                missing_address:
                  value:
                    error: user_address_required
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: method_not_allowed
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: token_generation_failed
components:
  schemas:
    TokenGenerationRequest:
      type: object
      required:
        - user_address
      properties:
        user_address:
          type: string
          description: Ethereum address of the user
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x1234567890abcdef1234567890abcdef12345678'
    TokenGenerationResponse:
      type: object
      properties:
        token:
          type: string
          description: JWT token string
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        expires_at:
          type: integer
          format: int64
          description: Token expiration timestamp (Unix timestamp)
          example: 1700000000
        rate_limit:
          type: object
          properties:
            rps:
              type: integer
              description: Requests per second allowed
              example: 1
            burst:
              type: integer
              description: Burst capacity for rate limiting
              example: 1
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error code or type
          example: invalid_json
        message:
          type: string
          description: Human-readable error message
          example: Invalid JSON format in request body

````