{
  "basePath": "/",
  "definitions": {
    "detections": {
      "items": {
        "properties": {
          "confidence": {
            "description": "Confidence value",
            "example": 100,
            "format": "float",
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          },
          "language": {
            "description": "Language code",
            "example": "en",
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "error-response": {
      "properties": {
        "error": {
          "description": "Error message",
          "type": "string"
        }
      },
      "type": "object"
    },
    "error-slow-down": {
      "properties": {
        "error": {
          "description": "Reason for slow down",
          "type": "string"
        }
      },
      "type": "object"
    },
    "frontend-settings": {
      "properties": {
        "apiKeys": {
          "description": "Whether the API key database is enabled.",
          "type": "boolean"
        },
        "charLimit": {
          "description": "Character input limit for this language (-1 indicates no limit)",
          "type": "integer"
        },
        "frontendTimeout": {
          "description": "Frontend translation timeout",
          "type": "integer"
        },
        "keyRequired": {
          "description": "Whether an API key is required.",
          "type": "boolean"
        },
        "language": {
          "properties": {
            "source": {
              "properties": {
                "code": {
                  "description": "Language code",
                  "type": "string"
                },
                "name": {
                  "description": "Human-readable language name (in English)",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "target": {
              "properties": {
                "code": {
                  "description": "Language code",
                  "type": "string"
                },
                "name": {
                  "description": "Human-readable language name (in English)",
                  "type": "string"
                }
              },
              "type": "object"
            }
          },
          "type": "object"
        },
        "suggestions": {
          "description": "Whether submitting suggestions is enabled.",
          "type": "boolean"
        },
        "supportedFilesFormat": {
          "description": "Supported files format",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "health-response": {
      "properties": {
        "status": {
          "description": "Health status",
          "example": "ok",
          "type": "string"
        }
      },
      "type": "object"
    },
    "languages": {
      "items": {
        "description": "Supported language",
        "properties": {
          "code": {
            "description": "Language code",
            "type": "string"
          },
          "name": {
            "description": "Human-readable language name (in English)",
            "type": "string"
          },
          "targets": {
            "description": "Supported target language codes",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "suggest-response": {
      "properties": {
        "success": {
          "description": "Whether submission was successful",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "translate": {
      "properties": {
        "alternatives": {
          "description": "Alternative translations",
          "oneOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "items": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "array"
            }
          ]
        },
        "detectedLanguage": {
          "oneOf": [
            {
              "properties": {
                "confidence": {
                  "description": "Confidence value",
                  "example": 100,
                  "format": "float",
                  "maximum": 100,
                  "minimum": 0,
                  "type": "number"
                },
                "language": {
                  "description": "Language code",
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "items": {
                "properties": {
                  "confidence": {
                    "description": "Confidence value",
                    "example": 100,
                    "format": "float",
                    "maximum": 100,
                    "minimum": 0,
                    "type": "number"
                  },
                  "language": {
                    "description": "Language code",
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "type": "array"
            }
          ]
        },
        "translatedText": {
          "description": "Translated text(s)",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ]
        }
      },
      "required": [
        "translatedText"
      ],
      "type": "object"
    },
    "translate-file": {
      "properties": {
        "translatedFileUrl": {
          "description": "Translated file url",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "info": {
    "description": "AI-First Translation Proxy — LLM-powered multilingual API",
    "license": {
      "name": "MIT"
    },
    "title": "flowLingua",
    "version": "0.1.0"
  },
  "paths": {
    "/detect": {
      "post": {
        "description": "",
        "parameters": [
          {
            "description": "Text to detect",
            "in": "formData",
            "name": "q",
            "required": true,
            "schema": {
              "example": "What language is this?",
              "type": "string"
            }
          },
          {
            "description": "API key",
            "in": "formData",
            "name": "api_key",
            "required": false,
            "schema": {
              "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detections",
            "schema": {
              "$ref": "#/definitions/detections"
            }
          },
          "400": {
            "description": "Invalid request",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "403": {
            "description": "Banned",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "429": {
            "description": "Slow down",
            "schema": {
              "$ref": "#/definitions/error-slow-down"
            }
          },
          "500": {
            "description": "Detection error",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "Detect Language of Text",
        "tags": [
          "translate"
        ]
      }
    },
    "/frontend/settings": {
      "get": {
        "description": "",
        "responses": {
          "200": {
            "description": "frontend settings",
            "schema": {
              "$ref": "#/definitions/frontend-settings"
            }
          }
        },
        "summary": "Retrieve Frontend Settings",
        "tags": [
          "misc"
        ]
      }
    },
    "/health": {
      "get": {
        "description": "",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "schema": {
              "$ref": "#/definitions/health-response"
            }
          }
        },
        "summary": "Health Check",
        "tags": [
          "misc"
        ]
      }
    },
    "/languages": {
      "get": {
        "description": "",
        "responses": {
          "200": {
            "description": "List of supported languages",
            "schema": {
              "$ref": "#/definitions/languages"
            }
          }
        },
        "summary": "Get Supported Languages",
        "tags": [
          "translate"
        ]
      }
    },
    "/suggest": {
      "post": {
        "description": "",
        "parameters": [
          {
            "description": "Original text",
            "in": "formData",
            "name": "q",
            "required": true,
            "schema": {
              "example": "Hello world!",
              "type": "string"
            }
          },
          {
            "description": "Suggested translation",
            "in": "formData",
            "name": "s",
            "required": true,
            "schema": {
              "example": "¡Hola mundo!",
              "type": "string"
            }
          },
          {
            "description": "Language of original text",
            "in": "formData",
            "name": "source",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          },
          {
            "description": "Language of suggested translation",
            "in": "formData",
            "name": "target",
            "required": true,
            "schema": {
              "example": "es",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/suggest-response"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "Submit a Suggestion to Improve a Translation",
        "tags": [
          "misc"
        ]
      }
    },
    "/translate": {
      "post": {
        "description": "",
        "parameters": [
          {
            "description": "Text(s) to translate",
            "in": "formData",
            "name": "q",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "example": "Hello world!",
                  "type": "string"
                },
                {
                  "example": [
                    "Hello world!"
                  ],
                  "type": "array"
                }
              ]
            }
          },
          {
            "description": "Source language code or \"auto\" for auto detection",
            "in": "formData",
            "name": "source",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          },
          {
            "description": "Target language code",
            "in": "formData",
            "name": "target",
            "required": true,
            "schema": {
              "example": "es",
              "type": "string"
            }
          },
          {
            "description": "Format of source text:\n * `text` - Plain text\n * `html` - HTML markup\n",
            "in": "formData",
            "name": "format",
            "required": false,
            "schema": {
              "default": "text",
              "enum": [
                "text",
                "html"
              ],
              "example": "text",
              "type": "string"
            }
          },
          {
            "description": "Preferred number of alternative translations",
            "in": "formData",
            "name": "alternatives",
            "required": false,
            "schema": {
              "default": 0,
              "example": 3,
              "type": "integer"
            }
          },
          {
            "description": "API key",
            "in": "formData",
            "name": "api_key",
            "required": false,
            "schema": {
              "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Translation",
            "schema": {
              "$ref": "#/definitions/translate"
            }
          },
          "400": {
            "description": "Invalid request",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "403": {
            "description": "Banned",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "429": {
            "description": "Slow down",
            "schema": {
              "$ref": "#/definitions/error-slow-down"
            }
          },
          "500": {
            "description": "Translation error",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "Translate Text",
        "tags": [
          "translate"
        ]
      }
    },
    "/translate_file": {
      "post": {
        "consumes": [
          "multipart/form-data"
        ],
        "description": "",
        "parameters": [
          {
            "description": "File to translate",
            "in": "formData",
            "name": "file",
            "required": true,
            "type": "file"
          },
          {
            "description": "Source language code  or \"auto\" for auto detection",
            "in": "formData",
            "name": "source",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          },
          {
            "description": "Target language code",
            "in": "formData",
            "name": "target",
            "required": true,
            "schema": {
              "example": "es",
              "type": "string"
            }
          },
          {
            "description": "API key",
            "in": "formData",
            "name": "api_key",
            "required": false,
            "schema": {
              "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Translated file",
            "schema": {
              "$ref": "#/definitions/translate-file"
            }
          },
          "400": {
            "description": "Invalid request",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "403": {
            "description": "Banned",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "429": {
            "description": "Slow down",
            "schema": {
              "$ref": "#/definitions/error-slow-down"
            }
          },
          "500": {
            "description": "Translation error",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "Translate a File",
        "tags": [
          "translate"
        ]
      }
    }
  },
  "swagger": "2.0",
  "host": "api.flowlingua.theboomer.dev",
  "schemes": [
    "https"
  ]
}