{
  "openapi": "3.0.3",
  "info": {
    "title": "The CloudConvert Developer API",
    "description": "Enterprise-grade REST API for universal file conversions, bank statement extraction, biometric passport photo studio, audio/video transcoding, vocal stem separation, neural speech synthesis, OCR, and cloud downloader workflows.",
    "version": "1.1.0",
    "contact": {
      "name": "CloudConvert Developer Support",
      "url": "http://localhost:3000/api-doc"
    }
  },
  "servers": [
    {
      "url": "https://api.thecloudconvert.com/api/v1",
      "description": "Live Production API Gateway"
    },
    {
      "url": "http://localhost:3000/api/v1",
      "description": "Local Development (Next.js Proxy)"
    },
    {
      "url": "http://127.0.0.1:8008/api/v1",
      "description": "Direct Flask Conversion Backend"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "System & Health",
      "description": "Server health status and converter capability discovery"
    },
    {
      "name": "File Conversions",
      "description": "Asynchronous job creation, status polling, and converted file downloads"
    },
    {
      "name": "Financial & Statements",
      "description": "Tabular bank statement and invoice extraction into Excel, CSV, and JSON"
    },
    {
      "name": "Photo Studio & AI Vision",
      "description": "Biometric passport/ID photos, AI background removal, image upscaling, and color extraction"
    },
    {
      "name": "Audio & Speech",
      "description": "Neural Text-to-Speech, Speech-to-Text transcription, and AI vocal/stem removal"
    },
    {
      "name": "Video & Media",
      "description": "Video downloader, audio extraction, animated GIF generation, and Subtitle Studio"
    },
    {
      "name": "Document & Web",
      "description": "Web page to vector PDF, document text extraction, and PDF Suite manipulation"
    },
    {
      "name": "Developer & Data Tools",
      "description": "Data Hub (JSON/CSV/XML/YAML/Excel), 3D model conversion, Lottie, SVG, and code compression"
    },
    {
      "name": "Languages & i18n",
      "description": "Dynamic internationalization, locale switcher data, and translation dictionaries"
    },
    {
      "name": "API Key Management",
      "description": "API keys creation, quota tracking, and revocation"
    },
    {
      "name": "Admin & Billing",
      "description": "Subscription packages, invoices, payments, and gateway configurations"
    },
    {
      "name": "Mobile Endpoints",
      "description": "Mobile remote configuration, device registration, and In-App Purchase verification"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "System & Health"
        ],
        "summary": "Health Check",
        "description": "Verify system health, database connection, and storage availability.",
        "responses": {
          "200": {
            "description": "System operational",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "healthy"
                    },
                    "version": {
                      "type": "string",
                      "example": "1.1.0"
                    },
                    "database": {
                      "type": "string",
                      "example": "connected"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/converters": {
      "get": {
        "tags": [
          "System & Health"
        ],
        "summary": "List Supported Converters & Formats",
        "description": "Query all available conversion engines, input/output formats, and option schemas.",
        "responses": {
          "200": {
            "description": "List of converter configurations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "converters": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/jobs": {
      "post": {
        "tags": [
          "File Conversions"
        ],
        "summary": "Create Conversion Job",
        "description": "Upload a file or provide a source file to convert into target format using FFmpeg, LibreOffice, Pandoc, or ImageMagick.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "output_format"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Source file to convert"
                  },
                  "output_format": {
                    "type": "string",
                    "example": "pdf",
                    "description": "Target format (pdf, mp4, mp3, docx, png, etc.)"
                  },
                  "category": {
                    "type": "string",
                    "example": "document",
                    "description": "Optional category (document, image, video, audio, font, archive)"
                  },
                  "options": {
                    "type": "string",
                    "example": "{}",
                    "description": "JSON string of conversion options"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Conversion Job Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request or unsupported format"
          },
          "401": {
            "description": "Invalid or missing API key"
          }
        }
      }
    },
    "/jobs/{job_uuid}": {
      "get": {
        "tags": [
          "File Conversions"
        ],
        "summary": "Get Job Status & Progress",
        "description": "Retrieve status, percentage progress, and download links for a specific job.",
        "parameters": [
          {
            "name": "job_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the conversion job"
          }
        ],
        "responses": {
          "200": {
            "description": "Job status details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatus"
                }
              }
            }
          },
          "404": {
            "description": "Job not found"
          }
        }
      }
    },
    "/jobs/{job_uuid}/cancel": {
      "post": {
        "tags": [
          "File Conversions"
        ],
        "summary": "Cancel Conversion Job",
        "description": "Cancel a running or queued background conversion job.",
        "parameters": [
          {
            "name": "job_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job cancelled successfully"
          },
          "404": {
            "description": "Job not found"
          }
        }
      }
    },
    "/files/{job_uuid}/download": {
      "get": {
        "tags": [
          "File Conversions"
        ],
        "summary": "Download Converted File",
        "description": "Download the output file of a successfully completed job as an attachment.",
        "parameters": [
          {
            "name": "job_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Output file binary stream",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "File or job not found"
          }
        }
      }
    },
    "/files/batch-download": {
      "post": {
        "tags": [
          "File Conversions"
        ],
        "summary": "Batch Download ZIP",
        "description": "Bundle multiple finished job files into a single downloadable ZIP archive.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "job_ids"
                ],
                "properties": {
                  "job_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "c9a712f0-1e5b-43a1-9a72-88ef9213bc01",
                      "8fa19e34-5f4b-47e1-8a8b-a3be81bdf904"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ZIP archive binary stream",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/financial/extract-statement": {
      "post": {
        "tags": [
          "Financial & Statements"
        ],
        "summary": "Extract Bank Statement & Invoice to Spreadsheet",
        "description": "Parse tabular statement data from Indonesian banks (BCA, Mandiri, BRI, BNI) or PDF invoices into Excel (.xlsx), CSV, or JSON.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Bank statement PDF file"
                  },
                  "target_format": {
                    "type": "string",
                    "enum": [
                      "xlsx",
                      "csv",
                      "json"
                    ],
                    "default": "xlsx"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Extraction completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "job_id": {
                      "type": "string",
                      "example": "8fa19e34-5f4b-47e1-8a8b-a3be81bdf904"
                    },
                    "total_rows": {
                      "type": "integer",
                      "example": 128
                    },
                    "headers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "Date",
                        "Description",
                        "Type",
                        "Amount",
                        "Balance"
                      ]
                    },
                    "format": {
                      "type": "string",
                      "example": "xlsx"
                    },
                    "filename": {
                      "type": "string",
                      "example": "rekening_koran_extracted.xlsx"
                    },
                    "filesize_kb": {
                      "type": "number",
                      "example": 42.5
                    },
                    "download_url": {
                      "type": "string",
                      "example": "/api/v1/files/8fa19e34-5f4b-47e1-8a8b-a3be81bdf904/download"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/photo-studio/process": {
      "post": {
        "tags": [
          "Photo Studio & AI Vision"
        ],
        "summary": "Biometric ID & Passport Photo Studio",
        "description": "Standardize portrait photos to official biometric dimensions (2x3, 3x4, 4x6, 2x2), apply formal background colors (Red, Blue, White, Transparent), and generate single photos or printable A4 sheets.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "size",
                  "background"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Source portrait photo"
                  },
                  "size": {
                    "type": "string",
                    "example": "3x4",
                    "description": "Target size: 2x3, 3x4, 4x6, or 2x2"
                  },
                  "background": {
                    "type": "string",
                    "example": "blue",
                    "description": "Target background: red, blue, white, or transparent"
                  },
                  "printable_sheet": {
                    "type": "boolean",
                    "default": false,
                    "description": "Generate A4 printable sheet in PDF"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Processed biometric photo ready",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "job_id": {
                      "type": "string",
                      "example": "4b68e9d2-9742-49da-8b5e-2f3b97b6932a"
                    },
                    "size": {
                      "type": "string",
                      "example": "3x4"
                    },
                    "dimensions": {
                      "type": "object",
                      "properties": {
                        "width": {
                          "type": "integer"
                        },
                        "height": {
                          "type": "integer"
                        }
                      }
                    },
                    "background": {
                      "type": "string",
                      "example": "blue"
                    },
                    "printable_sheet": {
                      "type": "boolean",
                      "example": false
                    },
                    "download_url": {
                      "type": "string",
                      "example": "/api/v1/files/4b68e9d2-9742-49da-8b5e-2f3b97b6932a/download"
                    },
                    "preview_url": {
                      "type": "string",
                      "example": "/api/v1/files/4b68e9d2-9742-49da-8b5e-2f3b97b6932a/preview"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/bg-remover/process": {
      "post": {
        "tags": [
          "Photo Studio & AI Vision"
        ],
        "summary": "AI Background Remover",
        "description": "Remove image background automatically using neural segmentation, returning clean PNG or WEBP with alpha transparency channel.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "webp"
                    ],
                    "default": "png"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image background removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "job_id": {
                      "type": "string",
                      "example": "c1f72a44-0199-4d32-9df7-71b3e944ef91"
                    },
                    "filename": {
                      "type": "string",
                      "example": "asset_nobg.png"
                    },
                    "download_url": {
                      "type": "string",
                      "example": "/api/v1/files/c1f72a44-0199-4d32-9df7-71b3e944ef91/download"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/image-upscaler/process": {
      "post": {
        "tags": [
          "Photo Studio & AI Vision"
        ],
        "summary": "AI Image Upscaler & Super-Resolution",
        "description": "Enlarge low-resolution images 2x or 4x with neural detail reconstruction.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "scale": {
                    "type": "integer",
                    "enum": [
                      2,
                      4
                    ],
                    "default": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image upscaled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "download_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/palette/extract": {
      "post": {
        "tags": [
          "Photo Studio & AI Vision"
        ],
        "summary": "Extract Color Palette",
        "description": "Extract dominant colors, color swatches, and hex codes from any image.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "max_colors": {
                    "type": "integer",
                    "default": 6
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Color palette extracted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dominant": {
                      "type": "string",
                      "example": "#1E40AF"
                    },
                    "palette": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "#1E40AF",
                        "#3B82F6",
                        "#DBEAFE",
                        "#111827"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/video-to-mp3/convert": {
      "post": {
        "tags": [
          "Video & Media"
        ],
        "summary": "Extract MP3 Audio from Video",
        "description": "Extract pristine audio track from any video file with configurable bitrate (96k to 320k) and channels.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "bitrate": {
                    "type": "string",
                    "example": "320k",
                    "default": "192k"
                  },
                  "channels": {
                    "type": "string",
                    "enum": [
                      "stereo",
                      "mono"
                    ],
                    "default": "stereo"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audio extraction complete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "download_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/video-downloader/info": {
      "post": {
        "tags": [
          "Video & Media"
        ],
        "summary": "Get Video Metadata",
        "description": "Fetch title, duration, thumbnail, and stream formats for a video URL (YouTube, TikTok, Instagram, Vimeo, etc.).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Video metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "duration": {
                      "type": "integer"
                    },
                    "thumbnail": {
                      "type": "string"
                    },
                    "formats": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/video-downloader/download": {
      "post": {
        "tags": [
          "Video & Media"
        ],
        "summary": "Download Online Video",
        "description": "Download online video or audio stream at specified resolution (4K, 1080p, 720p, MP3 audio).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
                  },
                  "quality": {
                    "type": "string",
                    "example": "1080p",
                    "default": "best"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "video",
                      "audio"
                    ],
                    "default": "video"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stream download URL or job created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "download_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vocal-remover/process": {
      "post": {
        "tags": [
          "Audio & Speech"
        ],
        "summary": "AI Vocal & Instrumental Stem Separator",
        "description": "Separate mixed music tracks into isolated vocals and backing accompaniment.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "mp3",
                      "wav"
                    ],
                    "default": "mp3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vocals and accompaniment stems generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "vocals_url": {
                      "type": "string"
                    },
                    "instrumental_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tts/convert": {
      "post": {
        "tags": [
          "Audio & Speech"
        ],
        "summary": "Text to Speech (TTS)",
        "description": "Synthesize realistic neural voice audio from text or uploaded document in 9+ languages.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text",
                  "voice"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "Welcome to The CloudConvert API."
                  },
                  "voice": {
                    "type": "string",
                    "example": "id-ID-GadisNeural"
                  },
                  "rate": {
                    "type": "string",
                    "example": "+0%",
                    "default": "+0%"
                  },
                  "pitch": {
                    "type": "string",
                    "example": "+0Hz",
                    "default": "+0Hz"
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "mp3",
                      "wav"
                    ],
                    "default": "mp3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Voice audio generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "audio_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tts/voices": {
      "get": {
        "tags": [
          "Audio & Speech"
        ],
        "summary": "List Available TTS Voices",
        "description": "List all neural voice identifiers and their supported languages and genders.",
        "responses": {
          "200": {
            "description": "Voices list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/stt/convert": {
      "post": {
        "tags": [
          "Audio & Speech"
        ],
        "summary": "Speech to Text (STT)",
        "description": "Transcribe audio speech into text or formatted Word document with automated punctuation.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "language": {
                    "type": "string",
                    "example": "id-ID",
                    "default": "id-ID"
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "txt",
                      "docx",
                      "json"
                    ],
                    "default": "txt"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Speech transcription result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "transcription": {
                      "type": "string"
                    },
                    "word_count": {
                      "type": "integer"
                    },
                    "download_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/web-to-pdf/convert": {
      "post": {
        "tags": [
          "Document & Web"
        ],
        "summary": "Web Page to Vector PDF",
        "description": "Render any public URL into pixel-perfect PDF using headless browser vector engine.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://news.ycombinator.com"
                  },
                  "format": {
                    "type": "string",
                    "example": "A4",
                    "default": "A4"
                  },
                  "orientation": {
                    "type": "string",
                    "enum": [
                      "portrait",
                      "landscape"
                    ],
                    "default": "portrait"
                  },
                  "delay": {
                    "type": "integer",
                    "default": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Web PDF generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "pdf_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data-hub/convert": {
      "post": {
        "tags": [
          "Developer & Data Tools"
        ],
        "summary": "Data Hub Format Conversion",
        "description": "Convert structured datasets bidirectionally across JSON, CSV, XML, YAML, and Excel (.xlsx).",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "source_format",
                  "target_format"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "raw_content": {
                    "type": "string"
                  },
                  "source_format": {
                    "type": "string",
                    "example": "csv"
                  },
                  "target_format": {
                    "type": "string",
                    "example": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Conversion result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "source_format": {
                      "type": "string"
                    },
                    "target_format": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/threed/convert": {
      "post": {
        "tags": [
          "Developer & Data Tools"
        ],
        "summary": "3D Model File Converter",
        "description": "Convert 3D mesh files between OBJ, STL, GLTF, FBX, and PLY.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "target_format"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "target_format": {
                    "type": "string",
                    "enum": [
                      "obj",
                      "stl",
                      "gltf",
                      "ply"
                    ],
                    "example": "gltf"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "3D Model converted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "download_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/languages": {
      "get": {
        "tags": [
          "Languages & i18n"
        ],
        "summary": "List Active Languages",
        "description": "Retrieve available active languages with direction (LTR/RTL), default locale, and country flags.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "frontend"
            },
            "description": "Language scope filter (frontend, all)"
          }
        ],
        "responses": {
          "200": {
            "description": "List of languages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/languages/{code}/translations": {
      "get": {
        "tags": [
          "Languages & i18n"
        ],
        "summary": "Get Language Translation Dictionary",
        "description": "Fetch key-value localized strings for a specific language code (e.g. en, id, ja, de, ar).",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ISO Language code (e.g., en, id, ja)"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "frontend"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dictionary of key-value translation strings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api-keys": {
      "get": {
        "tags": [
          "API Key Management"
        ],
        "summary": "List User API Keys & Quota",
        "description": "Query your account API key statuses, monthly request limit, used quota, and active subscription package capabilities.",
        "responses": {
          "200": {
            "description": "API keys and quota limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKeyItem"
                      }
                    },
                    "limits": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "API Key Management"
        ],
        "summary": "Generate New API Key",
        "description": "Create a new secret API key for headless automated integration.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Production Cloud Worker"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApiKeyItem"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api-keys/{id}": {
      "delete": {
        "tags": [
          "API Key Management"
        ],
        "summary": "Delete API Key",
        "description": "Permanently remove an API key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key deleted"
          }
        }
      }
    },
    "/api-keys/{id}/revoke": {
      "patch": {
        "tags": [
          "API Key Management"
        ],
        "summary": "Revoke API Key",
        "description": "Deactivate an API key immediately without deleting history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key revoked"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Authenticate requests using the X-API-Key header."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "APIKey",
        "description": "Authenticate requests using standard Bearer token header."
      }
    },
    "schemas": {
      "JobResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "job_id": {
            "type": "string",
            "example": "c9a712f0-1e5b-43a1-9a72-88ef9213bc01"
          },
          "job_uuid": {
            "type": "string",
            "example": "c9a712f0-1e5b-43a1-9a72-88ef9213bc01"
          },
          "status": {
            "type": "string",
            "example": "processing"
          },
          "operation": {
            "type": "string",
            "example": "convert"
          },
          "input_format": {
            "type": "string",
            "example": "docx"
          },
          "output_format": {
            "type": "string",
            "example": "pdf"
          },
          "message": {
            "type": "string",
            "example": "Conversion job initiated successfully"
          }
        }
      },
      "JobStatus": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "example": "c9a712f0-1e5b-43a1-9a72-88ef9213bc01"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "progress": {
            "type": "number",
            "example": 100
          },
          "download_url": {
            "type": "string",
            "example": "/api/v1/files/c9a712f0-1e5b-43a1-9a72-88ef9213bc01/download"
          },
          "output_file_name": {
            "type": "string",
            "example": "contract.pdf"
          },
          "output_size_bytes": {
            "type": "integer",
            "example": 1048576
          }
        }
      },
      "ApiKeyItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1
          },
          "name": {
            "type": "string",
            "example": "Production Server Key"
          },
          "key": {
            "type": "string",
            "example": "cc_live_8dd5••••••••b0"
          },
          "package_name": {
            "type": "string",
            "example": "Pro Plan"
          },
          "rate_limit_per_min": {
            "type": "integer",
            "example": 300
          },
          "monthly_limit": {
            "type": "integer",
            "example": 1000
          },
          "used_requests": {
            "type": "integer",
            "example": 42
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "created_at": {
            "type": "string",
            "example": "2026-10-10 12:00:00"
          }
        }
      }
    }
  }
}