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

      Develop Env
      https://dev.your-api-server.com
      Develop Env
      https://dev.your-api-server.com
      POST
      /codes
      Generate code for a given programming language.
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://dev.your-api-server.com/codes' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "max_tokens": 2048,
          "mode": "python",
          "model": "icortex-1",
          "n": 1,
          "temperature": null,
          "text": "string"
      }'
      Response Response Example
      {
          "data": {
              "outputs": [
                  {
                      "index": 0,
                      "text": "A beautiful sentence hand crafted by TextCortex."
                  }
              ],
              "remaining_credits": 0
          },
          "status": "success"
      }

      Request

      Body Params application/json
      max_tokens
      integer 
      optional
      The maximum number of tokens to generate.
      Default:
      2048
      mode
      enum<string> 
      required
      Code generation mode. This could be Python, Java, SQL, etc.
      Allowed values:
      pythonjavajavascriptgophpjs_regex
      model
      optional
      The language model to use.
      Allowed value:
      icortex-1
      Default:
      icortex-1
      n
      integer 
      optional
      The number of outputs to generate.
      Default:
      1
      temperature
      number  | null 
      optional
      The sampling temperature to be used in text generation. The higher the temperature, the higher the risk of the output to sound "made up".
      Default:
      null
      text
      string 
      required
      Instruction for the program.
      Examples

      Responses

      🟢200Success
      application/json
      Body
      data
      object 
      optional
      The response data.
      outputs
      array[object (OutputItem) {2}] 
      optional
      The list of generated texts.
      remaining_credits
      number 
      optional
      The remaining TextCortex credits.
      status
      string 
      optional
      The status of the response.
      Default:
      success
      Next
      Generate SQL queries
      Built with