{
  "openapi": "3.1.0",
  "info": {
    "title": "Reasoning Translator API",
    "version": "1.1.0"
  },
  "paths": {
    "/translate/text": {
      "post": {
        "tags": [
          "simple-translation"
        ],
        "summary": "Translate plain text into one to eight languages",
        "operationId": "translate_text_translate_text_post",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextTranslationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKey": []
          }
        ]
      }
    },
    "/translate/file": {
      "post": {
        "tags": [
          "simple-translation"
        ],
        "summary": "Translate a DOCX or XLSX into one to eight languages",
        "operationId": "translate_file_translate_file_post",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "target_languages"
                ],
                "additionalProperties": false,
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "One DOCX or XLSX, up to 30 MiB."
                  },
                  "target_languages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 8,
                    "uniqueItems": true
                  },
                  "source_language": {
                    "type": "string",
                    "default": "auto"
                  },
                  "context": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "glossary": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "tone": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "brief": {
                    "type": "string",
                    "maxLength": 10000
                  }
                }
              },
              "encoding": {
                "target_languages": {
                  "contentType": "application/json"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKey": []
          }
        ]
      }
    },
    "/translate/{translation_id}": {
      "get": {
        "tags": [
          "simple-translation"
        ],
        "summary": "Read progress and results by language",
        "operationId": "read_translation_translate__translation_id__get",
        "parameters": [
          {
            "name": "translation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Translation Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKey": []
          }
        ]
      }
    },
    "/translate/{translation_id}/retry": {
      "post": {
        "tags": [
          "simple-translation"
        ],
        "summary": "Retry failed languages without repeating successful translations",
        "operationId": "retry_translation_translate__translation_id__retry_post",
        "parameters": [
          {
            "name": "translation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Translation Id"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKey": []
          }
        ]
      }
    },
    "/translate/{translation_id}/files/{language}": {
      "get": {
        "tags": [
          "simple-translation"
        ],
        "summary": "Download a translated file for one language",
        "operationId": "download_file_translate__translation_id__files__language__get",
        "parameters": [
          {
            "name": "translation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Translation Id"
            }
          },
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Language"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "LanguageTranslation": {
        "properties": {
          "language": {
            "type": "string",
            "title": "Language"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "complete",
              "needs_review",
              "partial",
              "failed"
            ],
            "title": "Status"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Url"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "type": "object",
        "required": [
          "language",
          "status"
        ],
        "title": "LanguageTranslation"
      },
      "TextTranslationRequest": {
        "properties": {
          "target_languages": {
            "items": {
              "type": "string",
              "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?-[A-Z]{2}$"
            },
            "type": "array",
            "maxItems": 8,
            "minItems": 1,
            "uniqueItems": true,
            "title": "Target Languages"
          },
          "source_language": {
            "type": "string",
            "maxLength": 20,
            "title": "Source Language",
            "default": "auto"
          },
          "context": {
            "type": "string",
            "maxLength": 10000,
            "title": "Context",
            "default": ""
          },
          "glossary": {
            "type": "string",
            "maxLength": 20000,
            "title": "Glossary",
            "default": ""
          },
          "tone": {
            "type": "string",
            "maxLength": 2000,
            "title": "Tone",
            "default": ""
          },
          "brief": {
            "type": "string",
            "maxLength": 10000,
            "title": "Brief",
            "default": ""
          },
          "text": {
            "type": "string",
            "maxLength": 200000,
            "minLength": 1,
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "target_languages",
          "text"
        ],
        "title": "TextTranslationRequest"
      },
      "TranslationResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "complete",
              "needs_review",
              "partial",
              "failed"
            ],
            "title": "Status"
          },
          "status_url": {
            "type": "string",
            "title": "Status Url"
          },
          "target_languages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Target Languages"
          },
          "translations": {
            "items": {
              "$ref": "#/components/schemas/LanguageTranslation"
            },
            "type": "array",
            "title": "Translations"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "status_url",
          "target_languages",
          "translations",
          "created_at",
          "expires_at"
        ],
        "title": "TranslationResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "APIKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "wt_api_…",
        "description": "Unified customer key from Settings > API keys. Legacy wt_ keys and desktop sessions remain supported."
      }
    }
  },
  "servers": [
    {
      "url": "https://app.reasoning-translator.com/api/v1"
    }
  ]
}
