TextCortex
    TextCortex
    • Generate code
      POST
    • Generate SQL queries
      POST
    • Create ad
      POST
    • Create blog content
      POST
    • Autocomplete
      POST
    • Create email
      POST
    • Expand
      POST
    • Paraphrase
      POST
    • Create product description
      POST
    • Create product title
      POST
    • Rewrite
      POST
    • Simplify
      POST
    • Create social media post
      POST
    • Summarize
      POST
    • Translate
      POST
    • Create video description
      POST

      Autocomplete

      开发环境
      http://dev-cn.your-api-server.com
      开发环境
      http://dev-cn.your-api-server.com
      POST
      /texts/completions
      Generate a completion for rest of the text.
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'http://dev-cn.your-api-server.com/texts/completions' \
      --header 'Authorization;' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "formality": "default",
          "max_tokens": 2048,
          "model": "chat-sophos-1",
          "n": 1,
          "source_lang": "string",
          "target_lang": "string",
          "temperature": 0.65,
          "text": "string"
      }'
      响应示例响应示例
      {
          "data": {
              "outputs": [
                  {
                      "index": 0,
                      "text": "A beautiful sentence hand crafted by TextCortex."
                  }
              ],
              "remaining_credits": 0
          },
          "status": "success"
      }

      请求参数

      Header 参数
      Authorization
      string 
      必需
      默认值:
      Bearer 123
      Body 参数application/json
      formality
      可选
      The formality of the generated text, for languages that support it.
      枚举值:
      defaultmorelessprefer_moreprefer_less
      max_tokens
      integer 
      可选
      The maximum number of tokens to generate.
      默认值:
      2048
      model
      可选
      The language model to use.
      枚举值:
      velox-1aecus-1alta-1sophos-1chat-sophos-1gpt-3.5-turbo-16kmistral-smallmistral-large
      默认值:
      chat-sophos-1
      n
      integer 
      可选
      The number of outputs to generate.
      默认值:
      1
      source_lang
      string 
      可选
      The language of the source text. Available options are:
      "en": English (Default)
      "auto": The API will attempt to detect the language of the text and translate it.
      "bg": Bulgarian
      "cs": Czech
      "da": Danish
      "de": German
      "el": Greek
      "es": Spanish
      "et": Estonian
      "fi": Finnish
      "fr": French
      "hu": Hungarian
      "id": Indonesian
      "it": Italian
      "ja": Japanese
      "ko": Korean
      "lt": Lithuanian
      "lv": Latvian
      "nb": Norwegian
      "nl": Dutch
      "pl": Polish
      "pt": Portuguese (all Portuguese varieties mixed)
      "ro": Romanian
      "ru": Russian
      "sk": Slovak
      "sl": Slovenian
      "sv": Swedish
      "tr": Turkish
      "uk": Ukrainian
      "zh": Chinese
      target_lang
      string 
      可选
      The language which the text should be generated in. Available options are:
      "bg": Bulgarian
      "cs": Czech
      "da": Danish
      "de": German
      "el": Greek
      "en": Alias for en-us
      "en-gb": English (British)
      "en-us": English (American)
      "es": Spanish
      "et": Estonian
      "fi": Finnish
      "fr": French
      "hu": Hungarian
      "id": Indonesian
      "it": Italian
      "ja": Japanese
      "ko": Korean
      "lt": Lithuanian
      "lv": Latvian
      "nb": Norwegian
      "nl": Dutch
      "pl": Polish
      "pt": Alias for pt-pt
      "pt-br": Portuguese (Brazilian)
      "pt-pt": Portuguese (all Portuguese varieties excluding Brazilian Portuguese)
      "ro": Romanian
      "ru": Russian
      "sk": Slovak
      "sl": Slovenian
      "sv": Swedish
      "tr": Turkish
      "uk": Ukrainian
      "zh": Chinese (simplified)
      temperature
      number 
      可选
      The sampling temperature to be used in text generation. The higher the temperature, the higher the risk of the output to sound "made up".
      默认值:
      0.65
      text
      string 
      必需
      The text to complete.
      示例

      返回响应

      🟢200成功
      application/json
      Body
      data
      object 
      可选
      The response data.
      outputs
      array[object (OutputItem) {2}] 
      可选
      The list of generated texts.
      remaining_credits
      number 
      可选
      The remaining TextCortex credits.
      status
      string 
      可选
      The status of the response.
      默认值:
      success
      修改于 2024-04-18 07:25:34
      上一页
      Create blog content
      下一页
      Create email
      Built with