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

      Generate code

      开发环境
      http://dev-cn.your-api-server.com
      开发环境
      http://dev-cn.your-api-server.com
      POST
      /codes
      Generate code for a given programming language.
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'http://dev-cn.your-api-server.com/codes' \
      --header 'Authorization;' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "max_tokens": 2048,
          "mode": "python",
          "model": "icortex-1",
          "n": 1,
          "temperature": 0,
          "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
      max_tokens
      integer 
      可选
      The maximum number of tokens to generate.
      默认值:
      2048
      mode
      enum<string> 
      必需
      Code generation mode. This could be Python, Java, SQL, etc.
      枚举值:
      pythonjavajavascriptgophpjs_regex
      model
      可选
      The language model to use.
      枚举值:
      icortex-1
      默认值:
      icortex-1
      n
      integer 
      可选
      The number of outputs to generate.
      默认值:
      1
      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
      text
      string 
      必需
      Instruction for the program.
      示例

      返回响应

      🟢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
      下一页
      Generate SQL queries
      Built with