{
  "openapi": "3.0.0",
  "info": {
    "title": "Localization translation",
    "version": "1.0.0",
    "description": "API reference for Localization translation on Ace Data Cloud."
  },
  "servers": [
    {
      "url": "https://api.acedata.cloud",
      "description": "Ace Data Cloud API"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token from https://platform.acedata.cloud"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/localization/translate": {
      "post": {
        "summary": "Translate a JSON input into any localized file",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "data": {
                      "message.clickButton": {
                        "message": "Please click button to apply",
                        "description": "Localization Translate Response 200 Example Data Message Clickbutton"
                      }
                    },
                    "locale": "zh-CN"
                  },
                  "properties": {
                    "data": {
                      "type": "object",
                      "description": "Localization Translate Response 200 Data",
                      "properties": {
                        "message.clickButton": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "message": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "model": {
                      "type": "string",
                      "description": "Localization Translate Response 200 Model"
                    },
                    "locale": {
                      "type": "string",
                      "description": "Localization Translate Response 200 Locale"
                    }
                  }
                }
              }
            },
            "description": "Localization Translate Response 200"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "example": {
                        "error": {
                          "code": "token_mismatched",
                          "message": "The specified token is not matched with API."
                        },
                        "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                      },
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "token_mismatched",
                              "description": "Localization Translate Response 400 Error Code"
                            },
                            "message": {
                              "type": "string",
                              "example": "The specified token is not matched with API.",
                              "description": "Localization Translate Response 400 Error Message"
                            }
                          }
                        },
                        "trace_id": {
                          "type": "string",
                          "description": "Localization Translate Response 400 Trace Id"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "example": {
                        "error": {
                          "code": "api_not_implemented",
                          "message": "The API is not implemented."
                        },
                        "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                      },
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "api_not_implemented",
                              "description": "Localization Translate Response 400 Error Code 2"
                            },
                            "message": {
                              "type": "string",
                              "example": "The API is not implemented.",
                              "description": "Localization Translate Response 400 Error Message 2"
                            }
                          }
                        },
                        "trace_id": {
                          "type": "string",
                          "description": "Localization Translate Response 400 Trace Id 2"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "description": "Localization Translate Response 400"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "example": {
                        "error": {
                          "code": "invalid_token",
                          "message": "The specified token is invalid or wrong."
                        },
                        "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                      },
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "invalid_token",
                              "description": "Localization Translate Response 401 Error Code"
                            },
                            "message": {
                              "type": "string",
                              "example": "The specified token is invalid or wrong.",
                              "description": "Localization Translate Response 401 Error Message"
                            }
                          }
                        },
                        "trace_id": {
                          "type": "string",
                          "description": "Localization Translate Response 401 Trace Id"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "description": "Localization Translate Response 401"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "example": {
                        "error": {
                          "code": "too_many_requests",
                          "message": "You have exceeded the rate limit."
                        },
                        "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                      },
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "too_many_requests",
                              "description": "Localization Translate Response 429 Error Code"
                            },
                            "message": {
                              "type": "string",
                              "example": "You have exceeded the rate limit.",
                              "description": "Localization Translate Response 429 Error Message"
                            }
                          }
                        },
                        "trace_id": {
                          "type": "string",
                          "description": "Localization Translate Response 429 Trace Id"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "description": "Localization Translate Response 429"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "example": {
                        "error": {
                          "code": "api_error",
                          "message": "Internal server error."
                        },
                        "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                      },
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "api_error",
                              "description": "Localization Translate Response 500 Error Code"
                            },
                            "message": {
                              "type": "string",
                              "example": "Internal server error.",
                              "description": "Localization Translate Response 500 Error Message"
                            }
                          }
                        },
                        "trace_id": {
                          "type": "string",
                          "description": "Localization Translate Response 500 Trace Id"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "description": "Localization Translate Response 500"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "accept",
            "schema": {
              "enum": [
                "application/json"
              ],
              "type": "string"
            },
            "required": false,
            "description": "Localization Translate Param Accept"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input",
                  "locale",
                  "extension"
                ],
                "properties": {
                  "input": {
                    "example": "# Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph.",
                    "description": "Localization Translate Input",
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "additionalProperties": true
                      }
                    ]
                  },
                  "model": {
                    "enum": [
                      "gpt-3.5",
                      "gpt-4"
                    ],
                    "type": "string",
                    "description": "Localization Translate Model"
                  },
                  "locale": {
                    "enum": [
                      "en",
                      "de",
                      "pt",
                      "es",
                      "fr",
                      "zh-CN",
                      "zh-TW",
                      "it",
                      "ko",
                      "ja",
                      "ru",
                      "pl",
                      "fi",
                      "sv",
                      "el",
                      "uk",
                      "ar",
                      "sr"
                    ],
                    "type": "string",
                    "description": "Localization Translate Locale"
                  },
                  "extension": {
                    "enum": [
                      "md",
                      "json"
                    ],
                    "type": "string",
                    "description": "Localization Translate Extension",
                    "default": "md"
                  }
                },
                "oneOf": [
                  {
                    "properties": {
                      "extension": {
                        "type": "string",
                        "enum": [
                          "json"
                        ]
                      },
                      "input": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  {
                    "properties": {
                      "extension": {
                        "type": "string",
                        "enum": [
                          "md"
                        ]
                      },
                      "input": {
                        "type": "string"
                      }
                    }
                  }
                ]
              },
              "example": {
                "input": "# Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph.",
                "locale": "en",
                "extension": "md"
              }
            }
          },
          "required": true
        },
        "operationId": "createLocalizationTranslate"
      }
    }
  }
}
