info:
  description: |
    API for balancing chemical equations.

    **Authentication Options**:
    - Recommended: Bearer token via `Authorization` header.
    - Fallback (GET): `token` query parameter.
    - Fallback (POST): `apiKey` in JSON body.
  title: Chemical Equation Balancer API
  version: 1.2.0
openapi: 3.0.0
paths:
  /api/v1/chemical-equation-balancer:
    post:
      requestBody:
        content:
          application/json:
            schema:
              properties:
                apiKey:
                  type: string
                equation:
                  type: string
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  balancedEquation:
                    type: string
                type: object
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '429':
          description: Too many requests
      summary: Balance a chemical equation.
    get:
      parameters:
        - in: query
          name: equation
          schema:
            type: string
          required: true
          description: The chemical equation to balance.
        - in: query
          name: token
          schema:
            type: string
          required: false
          description: Authentication token (alternative to Bearer header).
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  balancedEquation:
                    type: string
                type: object
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '429':
          description: Too many requests
      summary: Balance a chemical equation.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

security:
  - bearerAuth: []  # Global security, but overridden per-path
servers:
- url: https://infinitode.netlify.app
