Parameters

  • messages

    • Type: array
    • Required: true
  • model

    • Type: string
    • Required: false
    • Options: openchat_v3.2_mistral
    • Default: openchat_v3.2_mistral
  • max_tokens

    • Type: number
    • Required: false
    • Default: 512
  • temperature

    • Type: number
    • Required: false
    • Default: 0.9
  • id

    • Type: string
    • Required: false
    • Description: ID of the conversation (used for data saving)
    • Default: a582c198-c87a-4180-bfc1-4b316bd21fb0
  • autoSystemMessage

    • Type: boolean
    • Required: false
    • Description: Send system messages automatically
    • Default: true

Response

  • result

    • Type: string
  • done

    • Type: boolean
  • cost

    • Type: number
  • finishReason

    • Type: string
  • id

    • Type: string
    • Description: ID of the conversation (used for data saving)

Examples

OpenChat models example
import axios from "axios";
(async () => {
  let response = await axios({
    method: "post",
    url: 'https://api.turing.sh/text/openchat',
    headers: {
      "Content-Type": "application/json",
      Authorization: "Bearer YOUR_API_KEY",
      "x-captcha-token": "Captcha key"
    },
    data: {
"messages": "array",
"model": "openchat_v3.2_mistral",
"max_tokens": 512,
"temperature": 0.9,
"id": "a582c198-c87a-4180-bfc1-4b316bd21fb0",
"autoSystemMessage": true
},
  })
})();