openapi: 3.0.3
info:
  title: ANIMA API
  version: 9.0.0
  description: |
    Unified OpenAPI definition for ANIMA Verify and ANIMA Identity surfaces.
servers:
  - url: https://animaid.to
paths:
  /api/verify/token:
    post:
      summary: Verify ANIMA token
      operationId: verifyToken
      tags: [ANIMA Verify]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [token, siteKey, secretKey]
              properties:
                token: { type: string }
                siteKey: { type: string }
                secretKey: { type: string }
      responses:
        '200':
          description: Verification response
          headers:
            X-RateLimit-Limit:
              schema: { type: integer }
            X-RateLimit-Remaining:
              schema: { type: integer }
            X-RateLimit-Reset:
              schema: { type: integer }
            Retry-After:
              schema: { type: integer }
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  human: { type: boolean }
                  status: { type: string }
                  confidence: { type: number }
  /api/embed/session:
    post:
      summary: Create ANIMA Identity embed session
      operationId: createEmbedSession
      tags: [ANIMA Identity]
      parameters:
        - in: header
          name: X-Api-Key
          required: true
          schema: { type: string }
        - in: header
          name: X-Api-Secret
          required: true
          schema: { type: string }
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                required_level:
                  type: string
                  enum: [basic, accredited, institutional]
                chain:
                  type: string
                steps:
                  type: array
                  items: { type: string }
                redirect_url:
                  type: string
                  format: uri
      responses:
        '201':
          description: Session created
          headers:
            X-RateLimit-Limit:
              schema: { type: integer }
            X-RateLimit-Remaining:
              schema: { type: integer }
            X-RateLimit-Reset:
              schema: { type: integer }
            Retry-After:
              schema: { type: integer }
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id: { type: string }
                  verify_url: { type: string, format: uri }
                  expires_at: { type: string, format: date-time }
  /api/enterprise/quote:
    post:
      summary: Generate enterprise quote
      operationId: generateEnterpriseQuote
      tags: [ANIMA Enterprise]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bot_verifications_per_month: { type: integer }
                identity_sessions_per_month: { type: integer }
                compliance_checks_per_month: { type: integer }
                attestations_per_month: { type: integer }
                commitment_term:
                  type: string
                  enum: [monthly, annual, three_year]
                deployment_mode:
                  type: string
                  enum: [cloud, on_premise, air_gapped]
                support_tier:
                  type: string
                  enum: [standard, priority, dedicated]
      responses:
        '200':
          description: Quote payload
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
openapi: 3.1.0
info:
  title: ANIMA API
  version: 9.0.0
  summary: ANIMA Verify and ANIMA Identity public API surface
  description: |
    Unified API specification for ANIMA Verify and ANIMA Identity.
servers:
  - url: https://animaid.to
paths:
  /api/verify/token:
    post:
      summary: Verify ANIMA token
      description: Validates a verification token against site and secret keys.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [token, siteKey, secretKey]
              properties:
                token: { type: string }
                siteKey: { type: string }
                secretKey: { type: string }
      responses:
        '200':
          description: Token validation result
          headers:
            X-RateLimit-Limit:
              description: Request limit for current window
              schema: { type: integer }
            X-RateLimit-Remaining:
              description: Remaining requests in current window
              schema: { type: integer }
            X-RateLimit-Reset:
              description: UNIX timestamp for window reset
              schema: { type: integer }
            Retry-After:
              description: Seconds to wait before retry on 429
              schema: { type: integer }
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  valid: { type: boolean }
                  human: { type: boolean }
                  status: { type: string }
                  confidence: { type: number }
        '429': { description: Rate limited }
  /api/embed/session:
    post:
      summary: Create ANIMA Identity embed session
      description: Creates a new identity verification embed session.
      security:
        - ApiKeyPair: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                required_level:
                  type: string
                  enum: [basic, accredited, institutional]
                steps:
                  type: array
                  items:
                    type: string
                    enum: [wallet, accreditation]
                chain:
                  type: string
                  enum: [ethereum, polygon, solana, base, bitcoin]
                user_ref: { type: string }
                webhook_url: { type: string, format: uri }
                redirect_url: { type: string, format: uri }
      responses:
        '201':
          description: Session created
          headers:
            X-RateLimit-Limit:
              schema: { type: integer }
            X-RateLimit-Remaining:
              schema: { type: integer }
            X-RateLimit-Reset:
              schema: { type: integer }
            Retry-After:
              schema: { type: integer }
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id: { type: string }
                  verify_url: { type: string, format: uri }
                  expires_at: { type: string, format: date-time }
        '429': { description: Rate limited }
components:
  securitySchemes:
    ApiKeyPair:
      type: apiKey
      in: header
      name: X-Api-Key
