openapi: 3.0.3
info:
  title: Verse Made Simple API
  version: 1.0.0
  description: |
    The VMS API provides programmatic access to 31,000+ AI-translated Bible verses and gospel narratives, combining the original King James Version with modern, highly accurate simplified translations.

    ## Base URL
    All API endpoints are relative to `https://versemadesimple.com/api/v1`

    ## Authentication
    This API uses API Keys for authentication. You can pass your key in two ways:
    1. HTTP Header: `X-API-Key: vms_your_key`
    2. Bearer Token: `Authorization: Bearer vms_your_key`

    Get your API key at [versemadesimple.com/dashboard](https://versemadesimple.com/dashboard)
  contact:
    name: API Support
    url: https://versemadesimple.com/contact
servers:
  - url: https://versemadesimple.com/api/v1
    description: Production Server
tags:
  - name: Verse
    description: Retrieve biblical verses and historical context
  - name: Usage
    description: Check your API usage and limits
paths:
  /verse/{slug}:
    get:
      tags:
        - Verse
      summary: Get a specific verse
      description: Retrieve a verse by its URL-friendly slug (e.g., `john-3-16`). Returns the original KJV text along with the requested modern translation style, historical context, and reflection points.
      parameters:
        - in: path
          name: slug
          required: true
          schema:
            type: string
            example: john-3-16
          description: The canonical slug for a verse. Format is `{book}-{chapter}-{verse}` (e.g., `1-john-1-9`, `genesis-1-1`).
        - in: query
          name: style
          required: false
          schema:
            type: string
            enum: [faithful, casual, all]
            default: faithful
          description: >
            Translation style to return:
            * `faithful` (default) - Precision AI translation retaining structural integrity.
            * `casual` - Conversational, modern tone optimized for TikTok/Gen Z audiences.
            * `all` - Returns both styles in a single response payload (counts as 1 API query).
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerseResponse'
        '400':
          description: Bad request (invalid styling)
        '403':
          description: Forbidden (Invalid API Key or restrictive domain limits)
        '404':
          description: Verse not found
        '429':
          description: Rate limit exceeded
      security:
        - ApiKeyAuth: []

  /usage:
    get:
      tags:
        - Usage
      summary: Get current usage metrics
      description: View your API consumption for the current billing cycle.
      responses:
        '200':
          description: Usage details
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_queries:
                    type: integer
                    example: 12500
                  limit:
                    type: integer
                    example: 50000
                  tier:
                    type: string
                    example: developer
      security:
        - ApiKeyAuth: []

components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
  schemas:
    VerseResponse:
      type: object
      properties:
        reference:
          type: string
          example: "John 3:16"
        slug:
          type: string
          example: "john-3-16"
        kjv_text:
          type: string
          example: "For God so loved the world, that he gave his only begotten Son..."
        faithful:
          type: object
          properties:
            simplified_text:
              type: string
            bottom_line:
              type: string
            historical_context:
              type: string
            practical_reflection:
              type: string
        casual:
          type: object
          properties:
            simplified_text:
              type: string
            bottom_line:
              type: string
        available_styles:
          type: object
          properties:
            faithful:
              type: boolean
            casual:
              type: boolean
        attribution:
          type: object
          properties:
            source:
              type: string
              example: "Verse Made Simple"
            url:
              type: string
              example: "https://versemadesimple.com/kjv/john/3/16"
            license:
              type: string
              example: "Proprietary — active API subscription required"
