{"openapi":"3.0.3","info":{"title":"i18n-agent Translation API","version":"1.0.1","description":"AI-powered translation service with cultural adaptation","contact":{"name":"API Support","email":"support@i18n-agent.com"}},"servers":[{"url":"http://localhost:3003","description":"Local development server"},{"url":"https://api.i18nagent.ai","description":"Production server"}],"security":[{"BearerAuth":[]}],"paths":{"/credits":{"get":{"summary":"Get team credits","description":"Get current credit balance for the authenticated team","operationId":"getCredits","tags":["Credits"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Team credit information","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the request was successful","example":true},"data":{"type":"object","properties":{"teamId":{"type":"string","description":"Team identifier","example":"team_123"},"teamName":{"type":"string","description":"Team name","example":"My Team"},"credits":{"type":"number","format":"decimal","description":"Current credit balance","example":125.5},"userId":{"type":"string","description":"User identifier","example":"user_456"}},"required":["teamId","teamName","credits","userId"]},"metadata":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"Response timestamp"}}}},"required":["success","data"]}}}},"401":{"description":"Unauthorized - Invalid or missing authentication token"},"500":{"description":"Internal server error"}}}},"/languages":{"get":{"summary":"List supported languages","description":"Get a list of all supported languages with quality ratings","operationId":"listSupportedLanguages","tags":["Languages"],"security":[],"responses":{"200":{"description":"List of supported languages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportedLanguages"}}}}}}},"/translations":{"post":{"summary":"Create translation (unified)","description":"Unified endpoint for translating both text and file content. Supports real AI translation with cultural adaptation OR pseudo-translation mode for testing i18n implementations without cost (set pseudoTranslation=true).","operationId":"createTranslation","tags":["Translation"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TranslateTextRequest"},{"$ref":"#/components/schemas/TranslateFileRequest"}]}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/TranslateFileMultipartRequest"}}}},"responses":{"200":{"description":"Translation result - returns either immediate result (sync) for small translations or queued job (async) for large translations","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TranslateTextResponse"},{"$ref":"#/components/schemas/AsyncTranslationResponse"}]},"examples":{"sync_single_language":{"summary":"Synchronous response (small translation, single language)","value":{"success":true,"originalTexts":["Hello world"],"translatedTexts":["Hola mundo"],"sourceLanguage":"en","targetLanguage":"es","metadata":{"targetAudience":"general","industry":"technology","processedAt":"2025-01-15T10:30:00Z","processingTimeMs":1250,"wordCount":2,"creditsUsed":0.002}}},"sync_multi_language":{"summary":"Synchronous response (small translation, multiple languages)","value":{"success":true,"originalTexts":["Hello world"],"translationsByLanguage":{"es":["Hola mundo"],"fr":["Bonjour le monde"],"de":["Hallo Welt"]},"sourceLanguage":"en","targetLanguages":["es","fr","de"],"metadata":{"targetAudience":"general","industry":"technology","processedAt":"2025-01-15T10:30:00Z","processingTimeMs":2500,"wordCount":2,"creditsUsed":0.006}}},"async_queued":{"summary":"Asynchronous response (large translation queued for background processing)","value":{"success":true,"status":"queued","jobId":"trans_abc123def456","message":"Translation queued for processing","estimatedTime":"2-5 minutes","statusUrl":"/translations/trans_abc123def456/status","resultUrl":"/translations/trans_abc123def456/result","metadata":{"wordCount":5000,"targetLanguages":["es","fr","de","ja","zh-CN"],"estimatedCredits":25}}}}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment required - insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - inactive API key or team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"summary":"Get translation history","description":"Get paginated list of translation jobs with optional filters for status, type, target languages, and date range","operationId":"getTranslationHistory","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1},"description":"Page number for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"maximum":100},"description":"Number of items per page"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED"]},"description":"Filter by translation status"},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["TEXT","FILE"]},"description":"Filter by translation type"},{"name":"targetLanguages","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of target language codes to filter by"},{"name":"fromDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filter translations created after this date"},{"name":"toDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filter translations created before this date"}],"responses":{"200":{"description":"Translation history with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"translations":{"type":"array","items":{"$ref":"#/components/schemas/TranslationHistoryItem"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"}}}}}}}},"401":{"description":"Unauthorized - Invalid or missing authentication token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/stream":{"post":{"summary":"Create translation with streaming progress","description":"Create translation with Server-Sent Events (SSE) for real-time progress updates. Supports text translation only (not files). Returns real-time progress updates as SSE events.","operationId":"createTranslationStream","tags":["Translation"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateTextRequest"},"examples":{"single_language":{"summary":"Single language translation with streaming","value":{"texts":["Hello world","How are you?"],"targetLanguage":"es","sourceLanguage":"en","targetAudience":"general","industry":"technology"}},"multi_language":{"summary":"Multi-language translation with streaming","value":{"texts":["Welcome to our platform"],"targetLanguages":["es","fr","de","ja"],"sourceLanguage":"en","targetAudience":"general","industry":"technology","context":"User interface welcome message"}}}}}},"responses":{"200":{"description":"SSE stream of translation progress","content":{"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream with progress updates"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/estimate":{"post":{"summary":"Get translation cost estimate","description":"Calculate word count and credits required for translation","operationId":"getTranslationEstimate","tags":["Translation"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Content to analyze"},"fileType":{"type":"string","default":"txt","description":"File type for content analysis"}},"required":["content"]}}}},"responses":{"200":{"description":"Cost estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationEstimate"}}}}}}},"/analyze":{"post":{"summary":"Validate source text for translation readiness","description":"Lightweight validation of source text to identify potential issues before translation. Returns validation results with error codes for programmatic access. This endpoint does NOT consume credits - it runs fast, deterministic validation without AI/LLM calls.","operationId":"validateSourceText","tags":["Analysis"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceTextValidationRequest"}}}},"responses":{"200":{"description":"Validation results with issues and error codes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceTextValidationResponse"}}}},"400":{"description":"Bad request - content is required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error - analysis failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/{id}":{"get":{"summary":"Get translation details","description":"Get details of a specific translation by ID","operationId":"getTranslation","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Translation ID"}],"responses":{"200":{"description":"Translation details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationDetails"}}}},"404":{"description":"Translation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/{id}/status":{"get":{"summary":"Get translation status","description":"Get real-time status of a translation job with detailed progress tracking including: progress percentage, elapsed time, estimated time remaining, checkpoint information, partial completion for multi-language translations, and presigned download URLs for completed results.","operationId":"getTranslationStatus","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Translation ID"}],"responses":{"200":{"description":"Translation status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationStatus"}}}}}}},"/translations/{id}/result":{"get":{"summary":"Download translation result","description":"Download the translated content","operationId":"downloadTranslationResult","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Translation ID"},{"name":"language","in":"query","required":false,"schema":{"type":"string"},"description":"Language code for specific language result"}],"responses":{"200":{"description":"Translation result file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}}},"/translations/{id}/original":{"get":{"summary":"Download original file","description":"Download the original uploaded file","operationId":"downloadOriginalFile","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Translation ID"}],"responses":{"200":{"description":"Original file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}}},"/translations/{id}/resume":{"post":{"summary":"Resume translation from checkpoint","description":"Resume a failed or interrupted translation from a specific checkpoint or automatically from the last successful checkpoint","operationId":"resumeTranslation","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Translation ID"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeTranslationRequest"}}}},"responses":{"200":{"description":"Translation resume initiated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeTranslationResponse"}}}},"400":{"description":"Bad request - Invalid checkpoint ID or translation not resumable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing authentication token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Translation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/jobs/active":{"get":{"summary":"Get active translation jobs","description":"Get list of currently active translation jobs","operationId":"getActiveJobs","tags":["Translation Jobs"],"responses":{"200":{"description":"List of active jobs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveJobsResponse"}}}}}}},"/translations/{jobId}/download":{"post":{"summary":"Download translation results","description":"Download completed translation results. Returns presigned download URLs organized by language. URLs expire after 24 hours.","operationId":"downloadTranslations","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"},"description":"Translation job ID"}],"responses":{"200":{"description":"Translation download information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadTranslationsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Translation job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/{jobId}/files/{language}":{"get":{"summary":"Download translation file for specific language","description":"Download a single translation file for a specific target language. Returns the file content directly with appropriate Content-Type header.","operationId":"downloadLanguageFile","tags":["Translation Jobs"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"},"description":"Translation job ID"},{"name":"language","in":"path","required":true,"schema":{"type":"string"},"description":"Target language code (e.g., 'es', 'fr', 'ja')"}],"responses":{"200":{"description":"Translation file content","content":{"application/json":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request - Translation not completed or language not available","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"currentStatus":{"type":"string"},"availableLanguages":{"type":"array","items":{"type":"string"}}}}}}},"404":{"description":"Translation job or language not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/namespaces/{namespace}/translations/upload":{"post":{"summary":"Upload translation file for namespace reuse","description":"Upload existing translation file to a namespace for future reuse. This enables cost optimization by reusing previously translated strings. The file is processed and translation pairs are extracted for caching.","operationId":"uploadNamespaceTranslation","tags":["Namespace Translations"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{3,50}$"},"description":"Namespace identifier (3-50 chars, alphanumeric + hyphens/underscores only)"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Translation file to upload"},"sourceLocale":{"type":"string","description":"Source language code (e.g., 'en')","example":"en"},"targetLocale":{"type":"string","description":"Target language code (e.g., 'es')","example":"es"}},"required":["file","sourceLocale","targetLocale"]}}}},"responses":{"200":{"description":"File uploaded and processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"fileId":{"type":"string"},"pairsStored":{"type":"integer","description":"Number of new translation pairs stored"},"pairsUpdated":{"type":"integer","description":"Number of existing translation pairs updated"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request - Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Namespace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Duplicate file - This file was already uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"existingFileId":{"type":"string"}}}}}}}}},"/namespaces/{namespace}/translations/stats":{"get":{"summary":"Get namespace translation statistics","description":"Get statistics about uploaded translation files and cache reuse for a namespace","operationId":"getNamespaceStats","tags":["Namespace Translations"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"},"description":"Namespace identifier"}],"responses":{"200":{"description":"Namespace statistics","content":{"application/json":{"schema":{"type":"object","properties":{"namespaceId":{"type":"string"},"namespaceName":{"type":"string"},"totalFiles":{"type":"integer"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"baseFileName":{"type":"string"},"sourceLocale":{"type":"string"},"targetLocale":{"type":"string"},"pairsExtracted":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}}},"cacheStatistics":{"type":"array","items":{"type":"object","properties":{"sourceLocale":{"type":"string"},"targetLocale":{"type":"string"},"pairCount":{"type":"integer"},"totalReuses":{"type":"integer"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Namespace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/namespaces/{namespace}/translations/files":{"get":{"summary":"List uploaded translation files in namespace","description":"Get paginated list of uploaded translation files for a namespace","operationId":"listNamespaceFiles","tags":["Namespace Translations"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"},"description":"Namespace identifier"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100},"description":"Maximum number of files to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Number of files to skip for pagination"}],"responses":{"200":{"description":"List of uploaded files","content":{"application/json":{"schema":{"type":"object","properties":{"namespaceId":{"type":"string"},"namespaceName":{"type":"string"},"totalFiles":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"baseFileName":{"type":"string"},"originalFileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer"},"sourceLocale":{"type":"string"},"targetLocale":{"type":"string"},"pairsExtracted":{"type":"integer"},"status":{"type":"string"},"uploadedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Namespace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/namespaces/{namespace}/translations/files/{fileId}":{"delete":{"summary":"Delete uploaded translation file","description":"Delete an uploaded translation file and all associated translation pairs from the cache","operationId":"deleteNamespaceFile","tags":["Namespace Translations"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"},"description":"Namespace identifier"},{"name":"fileId","in":"path","required":true,"schema":{"type":"string"},"description":"File ID to delete"}],"responses":{"200":{"description":"File deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"fileName":{"type":"string"},"pairsDeleted":{"type":"integer"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Namespace or file not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/translations/upload-parallel":{"post":{"summary":"Upload parallel translation files","description":"Upload source and target files in parallel for translation pair extraction and caching. Both files should have the same structure and file type.","operationId":"uploadParallelTranslations","tags":["Namespace Translations"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"sourceFile":{"type":"string","format":"binary","description":"Source language file"},"targetFile":{"type":"string","format":"binary","description":"Target language file (must match source file structure)"},"sourceLanguage":{"type":"string","description":"Source language code","example":"en"},"targetLanguage":{"type":"string","description":"Target language code","example":"es"},"namespace":{"type":"string","description":"Namespace for file organization (3-50 chars, alphanumeric + hyphens/underscores only)","pattern":"^[a-zA-Z0-9_-]{3,50}$","example":"my-app"}},"required":["sourceFile","targetFile","sourceLanguage","targetLanguage","namespace"]}}}},"responses":{"200":{"description":"Parallel files processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"fileId":{"type":"string"},"pairsStored":{"type":"integer","description":"Number of new translation pairs stored"},"pairsUpdated":{"type":"integer","description":"Number of existing translation pairs updated"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request - Invalid input or file type mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Duplicate file pair - This file pair was already uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"existingFileId":{"type":"string"}}}}}}}}},"/files/{filePath}":{"get":{"summary":"Download file from storage","description":"Serves files from local storage (development) or S3 (production). Used for accessing uploaded and translated files.","operationId":"downloadFile","tags":["Files"],"security":[],"parameters":[{"name":"filePath","in":"path","required":true,"schema":{"type":"string"},"description":"File path including any subdirectories (e.g., 'uploads/test-file.json' or 'translations/result.json')"}],"responses":{"200":{"description":"File content","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication (e.g., 'Bearer i18n_xxxxx')"}},"schemas":{"ContentAnalysisRequest":{"type":"object","properties":{"content":{"oneOf":[{"type":"string","description":"Text content to analyze"},{"type":"array","items":{"type":"string"},"description":"Array of texts to analyze"},{"type":"object","description":"Structured content to analyze"}],"description":"Content to analyze (text, array of texts, or structured object)"},"fileType":{"type":"string","description":"Optional file type if content is from a file","enum":["json","yaml","yml","xml","csv","txt","md","html","properties"]},"sourceLanguage":{"type":"string","description":"Source language code (auto-detected if not provided)"},"targetLanguage":{"type":"string","description":"Target language code for translation"},"industry":{"type":"string","default":"general","description":"Industry context"},"targetAudience":{"type":"string","default":"general","description":"Target audience"},"region":{"type":"string","description":"Specific region for localization"}},"required":["content","targetLanguage"]},"ContentAnalysisResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether analysis completed successfully"},"sourceLanguage":{"type":"string","description":"Detected or provided source language"},"languageConfidence":{"type":"number","minimum":0,"maximum":1,"description":"Confidence score for language detection"},"script":{"type":"string","description":"Script type (latin, chinese, japanese, etc.)"},"contentType":{"type":"string","enum":["marketing","technical","legal","medical","financial","educational","general","social","ecommerce"],"description":"Identified content type"},"tone":{"type":"string","enum":["formal","casual","professional","friendly","authoritative","conversational","persuasive"],"description":"Detected tone of content"},"domain":{"type":"object","properties":{"primary":{"type":"string","description":"Primary domain"},"secondary":{"type":"string","description":"Secondary domain if applicable"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"Domain detection confidence"}}},"translationStrategy":{"type":"string","enum":["literal","adaptive","creative","technical","marketing-optimized"],"description":"Recommended translation strategy"},"specialRequirements":{"type":"object","properties":{"preserveBrandNames":{"type":"boolean"},"preserveTechnicalTerms":{"type":"boolean"},"requiresLegalAccuracy":{"type":"boolean"},"requiresMedicalAccuracy":{"type":"boolean"},"hasMarketingCTA":{"type":"boolean"},"hasEmotionalAppeal":{"type":"boolean"},"requiresLocalization":{"type":"boolean"},"hasCurrencyOrNumbers":{"type":"boolean"}}},"patterns":{"type":"object","properties":{"hasPlaceholders":{"type":"boolean"},"hasHTMLTags":{"type":"boolean"},"hasMarkdown":{"type":"boolean"},"hasCode":{"type":"boolean"},"hasEmojis":{"type":"boolean"},"hasHashtags":{"type":"boolean"},"hasURLs":{"type":"boolean"},"hasDates":{"type":"boolean"}}},"quality":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100,"description":"Overall quality score"},"metrics":{"type":"object","description":"Detailed quality metrics"},"issues":{"type":"array","items":{"type":"string"},"description":"List of quality issues found"}}},"readinessScore":{"type":"integer","minimum":0,"maximum":100,"description":"Translation readiness score"},"isReadyForTranslation":{"type":"boolean","description":"Whether content is ready for translation"},"suggestions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Suggestion type"},"severity":{"type":"string","enum":["low","medium","high"],"description":"Issue severity"},"message":{"type":"string","description":"Suggestion message"},"recommendation":{"type":"string","description":"Recommended action"},"examples":{"type":"array","items":{"type":"string"},"description":"Examples from content"}}},"description":"Improvement suggestions"},"metadata":{"type":"object","properties":{"textCount":{"type":"integer","description":"Number of texts analyzed"},"totalCharacters":{"type":"integer","description":"Total character count"},"totalWords":{"type":"integer","description":"Total word count"},"creditsUsed":{"type":"number","description":"Credits consumed for this analysis (if API key provided)"},"estimatedCredits":{"type":"number","description":"Estimated credits for translation"},"averageWordLength":{"type":"number","description":"Average word length"},"sentenceComplexity":{"type":"string","enum":["simple","moderate","complex"],"description":"Sentence complexity level"},"readabilityLevel":{"type":"string","description":"Readability level"},"estimatedAudience":{"type":"string","description":"Estimated target audience"}}},"warnings":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Warning type"},"message":{"type":"string","description":"Warning message"}}},"description":"Warnings for potential issues"}},"required":["success"]},"SourceTextValidationRequest":{"type":"object","properties":{"content":{"type":"string","description":"Content to validate (text or JSON string)"},"fileType":{"type":"string","enum":["json","yaml","yml","xml","csv","txt","md","html","properties","auto"],"default":"auto","description":"File type hint for validation (auto-detected if not provided)"}},"required":["content"]},"SourceTextValidationResponse":{"type":"object","description":"Validation result for source text analysis","properties":{"success":{"type":"boolean","description":"Whether validation completed (same as isValid)"},"isValid":{"type":"boolean","description":"Whether content passed validation (no errors)"},"hasWarnings":{"type":"boolean","description":"Whether content has warnings (but no blocking errors)"},"wordCount":{"type":"integer","description":"Number of words in the content"},"issues":{"type":"array","description":"List of validation issues found","items":{"$ref":"#/components/schemas/SourceValidationIssue"}},"totalIssues":{"type":"integer","description":"Total number of issues found"},"summary":{"type":"object","description":"Summary counts by severity","properties":{"errors":{"type":"integer","description":"Number of error-level issues"},"warnings":{"type":"integer","description":"Number of warning-level issues"},"info":{"type":"integer","description":"Number of info-level issues"}}},"errorCodes":{"type":"object","description":"Reference enum of all possible error codes for programmatic access","properties":{"EMPTY_CONTENT":{"type":"string"},"ENCODING_ISSUES":{"type":"string"},"UNCLOSED_PLACEHOLDER":{"type":"string"},"NESTED_PLACEHOLDERS":{"type":"string"},"INCONSISTENT_PLACEHOLDER_FORMAT":{"type":"string"},"HARDCODED_PLURALS":{"type":"string"},"VERY_LONG_STRINGS":{"type":"string"},"INVISIBLE_CHARACTERS":{"type":"string"},"EMPTY_JSON_VALUES":{"type":"string"},"INVALID_JSON":{"type":"string"},"HARDCODED_VALUES":{"type":"string"}}}},"required":["success","isValid","hasWarnings","wordCount","issues","totalIssues","summary","errorCodes"]},"SourceValidationIssue":{"type":"object","description":"A single validation issue found in the content","properties":{"code":{"type":"string","description":"Error code for programmatic handling","enum":["EMPTY_CONTENT","ENCODING_ISSUES","UNCLOSED_PLACEHOLDER","NESTED_PLACEHOLDERS","INCONSISTENT_PLACEHOLDER_FORMAT","HARDCODED_PLURALS","VERY_LONG_STRINGS","INVISIBLE_CHARACTERS","EMPTY_JSON_VALUES","INVALID_JSON","HARDCODED_VALUES"]},"severity":{"type":"string","enum":["info","warning","error"],"description":"Issue severity level"},"message":{"type":"string","description":"Human-readable description of the issue"},"suggestion":{"type":"string","description":"Suggested fix for the issue"},"affectedCount":{"type":"integer","description":"Number of occurrences (optional)"},"examples":{"type":"array","items":{"type":"string"},"description":"Example occurrences from the content (optional)"}},"required":["code","severity","message","suggestion"]},"ServiceInfo":{"type":"object","properties":{"name":{"type":"string","example":"i18n-agent"},"version":{"type":"string","example":"1.0.0"},"description":{"type":"string"},"endpoints":{"type":"object","additionalProperties":{"type":"string"}},"file_upload_formats":{"type":"object","properties":{"multipart":{"type":"string"},"json_base64":{"type":"string"},"json_text":{"type":"string"},"json_path":{"type":"string"}}}}},"SupportedLanguages":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"es"},"name":{"type":"string","example":"Spanish"},"quality":{"type":"string","enum":["high","medium","low"],"example":"high"}},"required":["code","name","quality"]}}}},"TranslationEstimate":{"type":"object","properties":{"wordCount":{"type":"integer","description":"Number of words in the content"},"creditsRequired":{"type":"number","format":"float","description":"Credits required for translation"},"fileType":{"type":"string","description":"File type used for analysis","example":"txt"},"estimatedCostUSD":{"type":"number","format":"float","description":"Estimated cost in USD"}},"required":["wordCount","creditsRequired","fileType"]},"TranslationDetails":{"type":"object","properties":{"id":{"type":"string","description":"Translation job ID"},"type":{"type":"string","enum":["TEXT","FILE"],"description":"Type of translation job"},"fileName":{"type":"string","description":"Original file name (for file translations)"},"fileType":{"type":"string","description":"File type (json, yaml, etc.)"},"fileSize":{"type":"integer","description":"File size in bytes"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Target languages for translation"},"context":{"type":"string","description":"Translation context or instructions"},"wordCount":{"type":"integer","description":"Number of words in source content"},"creditsRequired":{"type":"number","format":"float","description":"Credits required for this translation"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED"],"description":"Current status of the translation"},"progress":{"type":"integer","minimum":0,"maximum":100,"description":"Progress percentage (0-100)"},"errorMessage":{"type":"string","description":"Error message if translation failed"},"translatedFiles":{"type":"object","description":"Translated file data (when completed)"},"createdAt":{"type":"string","format":"date-time","description":"When the job was created"},"startedAt":{"type":"string","format":"date-time","description":"When processing started"},"completedAt":{"type":"string","format":"date-time","description":"When the job was completed"},"user":{"type":"object","description":"User who created the translation"}},"required":["id","status","type"]},"TranslationStatus":{"type":"object","properties":{"id":{"type":"string","description":"Translation job ID"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED"],"description":"Current status"},"statusText":{"type":"string","description":"Localized human-readable status message"},"progress":{"type":"integer","minimum":0,"maximum":100,"description":"Progress percentage (0-100)"},"elapsedTime":{"type":"string","description":"Time elapsed since job started processing","example":"120 seconds"},"estimatedTimeRemaining":{"type":"string","description":"Estimated time remaining for completion","example":"45 seconds"},"message":{"type":"string","description":"Status message or error details","example":"Translation in progress... 65% complete"},"chunks":{"type":"object","description":"Batch/chunk processing progress (for large translations)","properties":{"completed":{"type":"integer","description":"Number of chunks completed"},"total":{"type":"integer","description":"Total number of chunks"}}},"lastCheckpointId":{"type":"string","description":"Opaque checkpoint ID for the last saved checkpoint (can be used to resume)"},"checkpointDescription":{"type":"string","description":"Human-readable description of current checkpoint progress","example":"Localization (65% complete, chunk 60%)"},"completedCount":{"type":"integer","description":"Number of languages that have completed translation. Available in all job states (processing, completed, failed).","example":2},"totalCount":{"type":"integer","description":"Total number of requested target languages. Available in all job states (processing, completed, failed).","example":5},"completedLanguages":{"type":"array","items":{"type":"string"},"description":"Array of language codes that have been completed (for multi-language translations with partial completion)","example":["es","fr","de"]},"partialCompletionMessage":{"type":"string","description":"Message describing partial completion status","example":"3 language(s) completed: es, fr, de"},"downloadUrls":{"type":"object","additionalProperties":{"type":"string","format":"uri"},"description":"Presigned download URLs for completed translations, organized by language code. Example: {\"es\": \"https://...\", \"fr\": \"https://...\"}. URLs expire after 1 hour. This is the primary method for accessing completed translation files."},"createdAt":{"type":"string","format":"date-time","description":"When the job was created"},"startedAt":{"type":"string","format":"date-time","description":"When the job started processing"},"completedAt":{"type":"string","format":"date-time","description":"When the job was completed"},"metadata":{"type":"object","description":"Additional metadata about the translation","additionalProperties":true},"result":{"type":"object","description":"Translation result (only when completed)","additionalProperties":true},"error":{"type":"string","description":"Error message (only when failed)"}},"required":["id","status"]},"ActiveJobsResponse":{"type":"object","properties":{"activeJobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["FILE","TEXT"]},"fileName":{"type":"string"},"fileType":{"type":"string"},"text":{"type":"string"},"targetLanguages":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["PENDING","PROCESSING"]},"progress":{"type":"number"},"wordCount":{"type":"number"},"creditsRequired":{"type":"number"},"createdAt":{"type":"string"},"startedAt":{"type":"string"},"originalPreview":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}}},"required":["id","type","targetLanguages","status"]}}},"required":["activeJobs"]},"TranslateFileMultipartRequest":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"File to translate"},"targetLanguage":{"type":"string","description":"Target language code (for single language translation)"},"targetLanguages":{"type":"string","description":"Comma-separated target language codes (e.g., 'es,fr,zh-CN') - for multi-language translation. Cannot be used together with targetLanguage."},"targetAudience":{"type":"string","default":"general","description":"Target audience"},"industry":{"type":"string","default":"technology","description":"Industry context"},"preserveKeys":{"type":"boolean","default":true,"description":"Preserve keys/structure for structured files"},"outputFormat":{"type":"string","default":"same","description":"Output format"},"sourceLanguage":{"type":"string","description":"Source language code (auto-detected if not provided)"},"region":{"type":"string","description":"Specific region for localization"},"context":{"type":"string","description":"Optional additional context or instructions for the translation"},"fileType":{"type":"string","enum":["json","yaml","yml","xml","csv","txt","md","markdown","html","htm","properties","pdf","docx","doc","plist","strings","stringsdict","auto"],"default":"auto","description":"File type (auto-detected if not specified)"},"skipWarnings":{"type":"boolean","default":false,"description":"Skip source text quality warnings and proceed with translation (default: false). When false, warnings about problematic source text will be returned in the response. When true, warnings are suppressed for cleaner output."},"namespace":{"type":"string","description":"Required namespace for file organization (3-50 chars, alphanumeric + hyphens/underscores only)","pattern":"^[a-zA-Z0-9_-]{3,50}$","example":"my-app"}},"required":["file","namespace"],"oneOf":[{"required":["targetLanguage"],"not":{"required":["targetLanguages"]}},{"required":["targetLanguages"],"not":{"required":["targetLanguage"]}}]},"TranslateTextRequest":{"type":"object","properties":{"texts":{"type":"array","items":{"type":"string"},"description":"Array of texts to translate"},"targetLanguage":{"type":"string","description":"Target language code (e.g., 'es', 'fr', 'ja') - for single language translation"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Array of target language codes (e.g., ['es', 'fr', 'zh-CN']) - for multi-language translation. Cannot be used together with targetLanguage."},"targetAudience":{"type":"string","default":"general","description":"Target audience (e.g., 'general', 'technical', 'casual', 'formal')"},"industry":{"type":"string","default":"technology","description":"Industry context (e.g., 'technology', 'healthcare', 'finance')"},"sourceLanguage":{"type":"string","description":"Source language code (auto-detected if not provided)"},"region":{"type":"string","description":"Specific region for localization (e.g., 'Spain', 'Mexico', 'Brazil')"},"context":{"type":"string","description":"Optional additional context or instructions for the translation (e.g., 'Keep technical terms in English', 'Use formal tone', 'Preserve brand names')"},"pseudoTranslation":{"type":"boolean","default":false,"description":"Enable pseudo-translation mode for testing i18n implementations without AI translation and NO credit cost. Transforms text with accents, brackets, and optional CJK characters to identify untranslated strings and test UI layout."},"pseudoOptions":{"type":"object","description":"Configuration options for pseudo-translation (only used when pseudoTranslation is true)","properties":{"addCJK":{"type":"boolean","default":false,"description":"Add CJK (Chinese/Japanese/Korean) characters to test wide character support"},"expansionRatio":{"type":"number","default":1,"minimum":1,"maximum":3,"description":"Length expansion ratio (1.0 = no expansion, 1.3 = 30% longer, 2.0 = double length) to test UI layout with longer strings"},"addSpecialChars":{"type":"boolean","default":false,"description":"Add special characters (§, ¶, †, ‡, ©, ®, ™, etc.) to test encoding/escaping"},"addBrackets":{"type":"boolean","default":true,"description":"Wrap strings with brackets [like this] to identify untranslated content"},"addAccents":{"type":"boolean","default":true,"description":"Replace Latin characters with accented equivalents (a→á, e→é, etc.)"}}},"skipWarnings":{"type":"boolean","default":false,"description":"Skip source text quality warnings and proceed with translation (default: false). When false, warnings about problematic source text (e.g., hard-to-translate phrases, pluralization issues, text expansion concerns) will be returned in the response under 'validationSuggestions' field. When true, these warnings are suppressed for cleaner output."}},"required":["texts"],"oneOf":[{"required":["targetLanguage"],"not":{"required":["targetLanguages"]}},{"required":["targetLanguages"],"not":{"required":["targetLanguage"]}}]},"TranslateTextResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the translation completed successfully","example":true},"originalTexts":{"type":"array","items":{"type":"string"},"description":"Original source texts"},"translatedTexts":{"type":"array","items":{"type":"string"},"description":"Translated texts (for single language translation, backward compatibility)"},"translationsByLanguage":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Translations organized by language code (for multi-language translation). Example: {\"es\": [\"Hola\"], \"fr\": [\"Bonjour\"]}"},"sourceLanguage":{"type":"string","description":"Detected or specified source language"},"targetLanguage":{"type":"string","description":"Target language code (for single language translation)"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Target language codes (for multi-language translation)"},"metadata":{"type":"object","properties":{"targetAudience":{"type":"string"},"industry":{"type":"string"},"processedAt":{"type":"string","format":"date-time"},"processingTimeMs":{"type":"number"},"wordCount":{"type":"integer"},"creditsUsed":{"type":"number","format":"float"}}},"validationSuggestions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Suggestion type"},"severity":{"type":"string","enum":["low","medium","high"],"description":"Issue severity"},"message":{"type":"string","description":"Suggestion message"},"recommendation":{"type":"string","description":"Recommended action"}}},"description":"Quality warnings about source text (only when skipWarnings is false)"}},"required":["success"],"oneOf":[{"required":["translatedTexts","targetLanguage"],"description":"Single language response"},{"required":["translationsByLanguage","targetLanguages"],"description":"Multi-language response"}]},"AsyncTranslationResponse":{"type":"object","description":"Response for large translations that are queued for background processing","properties":{"success":{"type":"boolean","description":"Whether the request was successfully queued","example":true},"status":{"type":"string","enum":["queued"],"description":"Status of the translation job (always 'queued' for async responses)","example":"queued"},"jobId":{"type":"string","description":"Unique identifier for the translation job - use this to check status and retrieve results","example":"trans_abc123def456"},"message":{"type":"string","description":"Human-readable status message","example":"Translation queued for processing"},"estimatedTime":{"type":"string","description":"Estimated time to complete the translation","example":"2-5 minutes"},"statusUrl":{"type":"string","description":"URL to check the translation status","example":"/translations/trans_abc123def456/status"},"resultUrl":{"type":"string","description":"URL to download the translation result (once completed)","example":"/translations/trans_abc123def456/result"},"metadata":{"type":"object","description":"Additional metadata about the queued translation","properties":{"wordCount":{"type":"integer","description":"Total word count to be translated","example":5000},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Target languages for translation","example":["es","fr","de","ja","zh-CN"]},"estimatedCredits":{"type":"number","format":"float","description":"Estimated credits to be consumed","example":25}}}},"required":["success","status","jobId","message"]},"TranslateFileRequest":{"type":"object","properties":{"fileContent":{"type":"string","description":"File content as string (required if fileBase64 and filePath not provided)"},"fileBase64":{"type":"string","description":"Base64 encoded file content (for binary files)"},"filePath":{"type":"string","description":"Server-side file path (for server-stored files)"},"fileName":{"type":"string","description":"Original file name"},"fileType":{"type":"string","enum":["json","yaml","yml","xml","csv","txt","md","html","properties","plist","strings","stringsdict","auto"],"default":"auto","description":"File type"},"targetLanguage":{"type":"string","description":"Target language code (for single language translation)"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Array of target language codes (e.g., ['es', 'fr', 'zh-CN']) - for multi-language translation. Cannot be used together with targetLanguage."},"targetAudience":{"type":"string","default":"general"},"industry":{"type":"string","default":"technology"},"preserveKeys":{"type":"boolean","default":true,"description":"Whether to preserve keys/structure"},"outputFormat":{"type":"string","enum":["same","json","yaml","txt"],"default":"same","description":"Output format"},"sourceLanguage":{"type":"string","description":"Source language code"},"region":{"type":"string","description":"Specific region for localization"},"context":{"type":"string","description":"Optional additional context or instructions for the translation (e.g., 'Keep technical terms in English', 'Use formal tone', 'Preserve brand names')"},"pseudoTranslation":{"type":"boolean","default":false,"description":"Enable pseudo-translation mode for testing i18n implementations without AI translation and NO credit cost. Transforms text with accents, brackets, and optional CJK characters to identify untranslated strings and test UI layout."},"pseudoOptions":{"type":"object","description":"Configuration options for pseudo-translation (only used when pseudoTranslation is true)","properties":{"addCJK":{"type":"boolean","default":false,"description":"Add CJK (Chinese/Japanese/Korean) characters to test wide character support"},"expansionRatio":{"type":"number","default":1,"minimum":1,"maximum":3,"description":"Length expansion ratio (1.0 = no expansion, 1.3 = 30% longer, 2.0 = double length) to test UI layout with longer strings"},"addSpecialChars":{"type":"boolean","default":false,"description":"Add special characters (§, ¶, †, ‡, ©, ®, ™, etc.) to test encoding/escaping"},"addBrackets":{"type":"boolean","default":true,"description":"Wrap strings with brackets [like this] to identify untranslated content"},"addAccents":{"type":"boolean","default":true,"description":"Replace Latin characters with accented equivalents (a→á, e→é, etc.)"}}},"skipWarnings":{"type":"boolean","default":false,"description":"Skip source text quality warnings and proceed with translation (default: false). When false, warnings about problematic source text (e.g., hard-to-translate phrases, pluralization issues, text expansion concerns) will be returned in the response under 'validationSuggestions' field. When true, these warnings are suppressed for cleaner output."},"namespace":{"type":"string","description":"Required namespace for file organization (3-50 chars, alphanumeric + hyphens/underscores only)","pattern":"^[a-zA-Z0-9_-]{3,50}$","example":"my-app"}},"allOf":[{"oneOf":[{"required":["fileContent","namespace"]},{"required":["fileBase64","namespace"]},{"required":["filePath","namespace"]}]},{"oneOf":[{"required":["targetLanguage"],"not":{"required":["targetLanguages"]}},{"required":["targetLanguages"],"not":{"required":["targetLanguage"]}}]}]},"TranslateFileResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the translation completed successfully","example":true},"translatedContent":{"type":"string","description":"Translated file content (for single language translation, backward compatibility)"},"translatedContentByLanguage":{"type":"object","additionalProperties":{"type":"string"},"description":"Translated content organized by language code (for multi-language translation). Example: {\"es\": \"contenido traducido\", \"fr\": \"contenu traduit\"}"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Target language codes (for multi-language translation)"},"metadata":{"type":"object","properties":{"originalFileName":{"type":"string"},"originalFileSize":{"type":"integer"},"detectedFileType":{"type":"string"},"sourceLanguage":{"type":"string"},"targetLanguage":{"type":"string","description":"Target language code (for single language translation)"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Target language codes (for multi-language translation)"},"wordCount":{"type":"integer"},"creditsUsed":{"type":"number","format":"float"}}},"validationSuggestions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Suggestion type"},"severity":{"type":"string","enum":["low","medium","high"],"description":"Issue severity"},"message":{"type":"string","description":"Suggestion message"},"recommendation":{"type":"string","description":"Recommended action"}}},"description":"Quality warnings about source text (only when skipWarnings is false)"}},"oneOf":[{"required":["success","translatedContent"],"description":"Single language response"},{"required":["success","translatedContentByLanguage","targetLanguages"],"description":"Multi-language response"}]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"success":{"type":"boolean","default":false}},"required":["error"]},"SSEProgressEvent":{"type":"object","properties":{"step":{"type":"integer","description":"Current step number"},"stepName":{"type":"string","description":"Name of the current step"},"progress":{"type":"integer","minimum":0,"maximum":100,"description":"Progress percentage"},"totalSteps":{"type":"integer","description":"Total number of steps"},"details":{"type":"string","description":"Detailed progress information"},"timestamp":{"type":"string","format":"date-time"},"result":{"type":"object","description":"Final result (only in completion event)"},"completed":{"type":"boolean","description":"Whether the translation is completed"},"error":{"type":"boolean","description":"Whether an error occurred"}}},"ResumeTranslationRequest":{"type":"object","properties":{"checkpointId":{"type":"string","description":"Opaque checkpoint ID to resume from (obtained from status endpoint). If not provided and autoDetect is true, will resume from last successful checkpoint.","example":"chk_eyJqb2JJZCI6InRyYW5zMTIzIiwiYmF0Y2giOjMsInN0ZXAiOjV9_a7f8d9"},"continueToEnd":{"type":"boolean","default":true,"description":"Whether to continue processing all remaining content after resuming"},"autoDetect":{"type":"boolean","default":true,"description":"Automatically detect and resume from the last successful checkpoint if checkpointId is not provided"}}},"ResumeTranslationResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the resume was successfully initiated"},"message":{"type":"string","description":"Status message","example":"Translation resume initiated"},"id":{"type":"string","description":"Translation job ID"},"checkpointId":{"type":"string","description":"The checkpoint ID from which the translation is resuming"},"description":{"type":"string","description":"Human-readable description of the resume action","example":"Resuming from last checkpoint"},"status":{"type":"string","enum":["PROCESSING"],"description":"Current status of the translation after resuming"}},"required":["success","message","id","status"]},"TranslationHistoryItem":{"type":"object","properties":{"id":{"type":"string","description":"Translation job ID"},"type":{"type":"string","enum":["TEXT","FILE"],"description":"Translation type"},"fileName":{"type":"string","description":"File name (for file translations)"},"fileType":{"type":"string","description":"File type (for file translations)"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Target language codes"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED"],"description":"Current status"},"progress":{"type":"integer","minimum":0,"maximum":100,"description":"Progress percentage"},"wordCount":{"type":"integer","description":"Word count"},"creditsRequired":{"type":"number","format":"float","description":"Credits required/used"},"createdAt":{"type":"string","format":"date-time","description":"Creation timestamp"},"startedAt":{"type":"string","format":"date-time","description":"Processing start timestamp"},"completedAt":{"type":"string","format":"date-time","description":"Completion timestamp"},"user":{"type":"object","description":"User information"}},"required":["id","type","targetLanguages","status"]},"DownloadTranslationsResponse":{"type":"object","properties":{"jobId":{"type":"string","description":"Translation job ID"},"fileName":{"type":"string","description":"Original file name"},"targetLanguages":{"type":"array","items":{"type":"string"},"description":"Completed target languages available for download"},"requestedLanguages":{"type":"array","items":{"type":"string"},"description":"Originally requested target languages"},"downloadUrls":{"type":"object","additionalProperties":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Presigned download URL (expires in 24 hours)"},"key":{"type":"string","description":"Storage key"}}},"description":"Presigned download URLs organized by language code. Example: {\"es\": {\"url\": \"https://...\", \"key\": \"...\"}, \"fr\": {\"url\": \"https://...\", \"key\": \"...\"}}"},"message":{"type":"string","description":"Status or information message","example":"Translation files ready for download. Use downloadUrls to access each language file."},"expiresIn":{"type":"string","description":"Expiration time for download URLs","example":"24 hours"},"partialFailure":{"type":"boolean","description":"Indicates if some languages failed to translate"},"failedLanguages":{"type":"array","items":{"type":"string"},"description":"Language codes that failed to translate"},"errorMessage":{"type":"string","description":"Error message for failed languages"},"warning":{"type":"string","description":"Warning message about partial completion","example":"Translation completed partially. 2 of 5 language(s) failed: ja, zh-CN"}},"required":["jobId","fileName","targetLanguages","downloadUrls","message"]}}},"tags":[{"name":"Service Info","description":"Service metadata and information"},{"name":"Credits","description":"Credit balance and usage endpoints"},{"name":"Languages","description":"Language support and configuration"},{"name":"Translation","description":"Main translation endpoints for text and files"},{"name":"Translation Jobs","description":"Translation job management and status tracking"},{"name":"Analysis","description":"Content analysis and verification endpoints"},{"name":"Namespace Translations","description":"Namespace-based translation file upload and management for cost optimization through reuse"},{"name":"Files","description":"File download and storage endpoints"}]}