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

# Qi Men Dun Jia chart



## OpenAPI

````yaml /openapi.public.json post /api/v3/chinese/qimen
openapi: 3.1.0
info:
  title: AstroM8 Public API
  version: 1.1.0
  description: >-
    Astrology calculations, reports, customer delivery, and enterprise
    workflows. Each operation declares whether it uses an API key or a customer
    session bearer token.
servers:
  - url: https://api.astrom8.com
    description: Production
security: []
tags:
  - name: Western
    description: Natal, relationship, return, progression, and transit calculations.
  - name: Vedic
    description: Lahiri sidereal Vedic calculations, matching, timing, and remedies.
  - name: Thai Astrology
    description: Thai calendar, auspicious timing, lunar, festival, and wheel tools.
  - name: Chinese & Korean
    description: BaZi, Qi Men Dun Jia, and Saju calculations.
  - name: Horoscopes
    description: Published daily and range horoscope content.
  - name: Reports
    description: Branded report generation and asynchronous job polling.
  - name: Tarot & Numerology
    description: Tarot spreads and Pythagorean numerology.
  - name: Uranian
    description: Uranian charts, midpoints, and planetary pictures.
  - name: Developer workflow
    description: Preflight capability eligibility and credit estimates.
  - name: Customer reports
    description: Session-authenticated report jobs and reusable brand profiles.
  - name: Customer delivery
    description: Session-authenticated webhooks and scheduled horoscope delivery.
  - name: Cultural Intelligence
    description: >-
      Enterprise API-key workflows for encrypted profiles, teams, and campaign
      content.
paths:
  /api/v3/chinese/qimen:
    post:
      tags:
        - Chinese & Korean
      summary: Qi Men Dun Jia chart
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/BirthSubjectInput'
                - $ref: '#/components/schemas/WhiteLabelBrandFields'
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - hour
                        - day
                        - month
                        - year
                      default: hour
                    gender:
                      type: string
                      enum:
                        - male
                        - female
                        - unknown
                      default: unknown
                    interpret:
                      type: boolean
                      default: false
                    language:
                      type: string
                      enum:
                        - zh
                        - zh-cn
                        - en
                        - th
                      default: zh
      responses:
        '200':
          description: Qi Men Dun Jia chart (+ optional interpretation).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QiMenChartResponse'
        '400':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: >-
            Tier locked — endpoint requires starter tier; `interpret=true`
            requires pro tier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '503':
          description: Interpretation provider not configured or unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BirthSubjectInput:
      type: object
      required:
        - date
        - time
        - latitude
        - longitude
        - timezoneOffsetMinutes
      properties:
        ayanamsa:
          type: string
          enum:
            - lahiri
          default: lahiri
        date:
          type: string
          format: date
          examples:
            - '1992-04-15'
        time:
          type: string
          pattern: ^\d{2}:\d{2}(:\d{2})?$
          examples:
            - '08:30:00'
        latitude:
          type: number
          minimum: -90
          maximum: 90
        longitude:
          type: number
          minimum: -180
          maximum: 180
        timezoneOffsetMinutes:
          type: integer
          minimum: -840
          maximum: 840
    WhiteLabelBrandFields:
      type: object
      description: >-
        Optional white-label AI voice controls for endpoints that generate LLM
        interpretation text.
      properties:
        brand_name:
          type: string
          minLength: 1
          maxLength: 60
          examples:
            - Moon & Co
        tone:
          type: string
          enum:
            - professional
            - casual
            - mystical
            - playful
            - formal
        audience:
          type: string
          enum:
            - consumer
            - employee
            - manager
            - customer
            - community
        safety_mode:
          type: string
          enum:
            - default
            - workplace
            - financial_wellness
            - entertainment
    QiMenChartResponse:
      type: object
      required:
        - type
        - dun_type
        - ju
        - ju_label
        - season
        - season_en
        - year_pillar
        - month_pillar
        - day_pillar
        - hour_pillar
        - xun_shou
        - zhi_fu_star
        - zhi_shi_door
        - palace5_lodge
        - palaces
        - ge_ju
        - ge_ju_en
        - interpretation
      properties:
        type:
          type: string
          enum:
            - hour
            - day
            - month
            - year
        dun_type:
          type: string
          enum:
            - yang
            - yin
        ju:
          type: integer
          minimum: 1
          maximum: 9
        ju_label:
          type: string
          description: Chinese ju label, e.g. 阳遁三局.
        season:
          type: string
          description: Governing solar term (Chinese).
        season_en:
          type: string
          description: Governing solar term (romanized).
        year_pillar:
          type: string
        month_pillar:
          type: string
        day_pillar:
          type: string
        hour_pillar:
          type: string
        xun_shou:
          type: string
        zhi_fu_star:
          type: string
        zhi_shi_door:
          type: string
        palace5_lodge:
          type: integer
          description: Palace where the center-palace star lodges.
        palaces:
          type: array
          items:
            $ref: '#/components/schemas/QiMenPalace'
        ge_ju:
          type: array
          items:
            type: string
          description: Detected auspicious/inauspicious patterns (Chinese).
        ge_ju_en:
          type: array
          items:
            type: string
        interpretation:
          type:
            - string
            - 'null'
          description: LLM interpretation when `interpret=true`; otherwise null.
    JsonError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: >-
            Stable slug (e.g. unauthorized, payment_required,
            internal_server_error).
        message:
          type: string
          description: Human-readable message safe for clients.
        code:
          type: string
          description: Optional provider-specific code.
        request_id:
          type: string
          description: Correlation id when middleware sets it.
    QiMenPalace:
      type: object
      required:
        - index
        - name
        - nameEn
        - element
        - qi_yi
        - door
        - doorEn
        - star
        - starEn
        - god
        - godEn
      properties:
        index:
          type: integer
          minimum: 1
          maximum: 9
        name:
          type: string
          description: Chinese palace trigram name, e.g. 坎.
        nameEn:
          type: string
          description: Romanized palace name, e.g. Kan.
        element:
          type: string
          description: Palace element (Water, Earth, Wood, Metal, Fire).
        qi_yi:
          type:
            - string
            - 'null'
          description: Earth-plate stem (三奇六仪); null for the center palace.
        door:
          type:
            - string
            - 'null'
        doorEn:
          type:
            - string
            - 'null'
        star:
          type:
            - string
            - 'null'
        starEn:
          type:
            - string
            - 'null'
        god:
          type:
            - string
            - 'null'
        godEn:
          type:
            - string
            - 'null'
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JsonError'
          example:
            error: unauthorized
            message: Invalid API key
            code: '401'
            request_id: 01HQXYZ...
    PaymentRequired:
      description: >-
        Insufficient credits (checked before work where applicable; deduction is
        atomic)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JsonError'
          example:
            error: payment_required
            message: Insufficient credits for this request
            code: '402'
            request_id: 01HQXYZ...
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: Use the raw API key as the Bearer token, or send X-API-Key instead.

````