openapi: "3.0.0"
info:
  title: ChangeThisFile API
  description: Free file conversion API supporting 500+ routes across images, video, audio, documents, ebooks, data, and archives.
  version: "1.0.0"
servers:
  - url: https://changethisfile.com
paths:
  /api/convert:
    post:
      operationId: convertFile
      summary: Convert a file to a different format
      description: Upload a file and convert it to the target format. No authentication required. Rate limited to 5 requests per minute.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file, target]
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to convert (max 25MB free, 500MB Pro)
                target:
                  type: string
                  description: Target format extension (e.g., "mp3", "jpg", "pdf")
      responses:
        "200":
          description: Converted file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Invalid request (missing file or unsupported conversion)
        "413":
          description: File too large
        "429":
          description: Rate limit exceeded
  /v1/convert:
    post:
      operationId: convertFileAuth
      summary: Convert a file (authenticated)
      description: Authenticated file conversion with higher limits. Requires API key.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file, target]
              properties:
                file:
                  type: string
                  format: binary
                target:
                  type: string
                  description: Target format extension
      responses:
        "200":
          description: Converted file
        "401":
          description: Invalid API key
        "429":
          description: Rate limit or quota exceeded
  /v1/formats:
    get:
      operationId: listFormats
      summary: List all supported formats and conversion routes
      responses:
        "200":
          description: JSON object with all supported formats and routes
  /v1/keys/free:
    post:
      operationId: createFreeApiKey
      summary: Create a free API key
      description: Get a free API key with 100 conversions per month. No credit card required.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [email]
              properties:
                email:
                  type: string
                  format: email
      responses:
        "200":
          description: API key created
          content:
            application/json:
              schema:
                type: object
                properties:
                  api_key:
                    type: string
                  plan:
                    type: string
                  monthly_limit:
                    type: integer
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer