Chat with GPT

POST /gpt/chat
application/json

Body

Responses

  • 200 application/json

    Default Response

    Hide response attributes Show response attributes object
    • status boolean

      Default value is true.

    • message string

      Default value is success.

    • result object

      Additional properties are allowed.

      Hide result attributes Show result attributes object
      • model string
      • message object

        Additional properties are allowed.

        Hide message attributes Show message attributes object
      • functions array[object]

        Additional properties are allowed.

  • 400 application/json

    Invalid request error

    Hide response attributes Show response attributes object
  • 401 application/json

    Authorization error

    Hide response attributes Show response attributes object
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
POST /gpt/chat
curl \
 -X POST https://api.itsrose.rest/gpt/chat \
 -H "Content-Type: application/json" \
 -d '{"model":"gpt-3.5-turbo","messages":[{"name":"Frieren","role":"user","content":"Define love in simple way"}],"internal_functions":["brainly"]}'
Request examples
{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "name": "Frieren",
      "role": "user",
      "content": "Define love in simple way"
    }
  ],
  "internal_functions": [
    "brainly"
  ]
}
Response examples (200)
{
  "status": true,
  "message": "success",
  "result": {
    "model": "string",
    "message": {
      "role": "assistant",
      "content": "string",
      "function_call": {
        "name": "string",
        "arguments": "string"
      }
    },
    "functions": [
      {}
    ]
  }
}
Response examples (400)
{
  "status": false,
  "message": "string",
  "result": {}
}
Response examples (401)
{
  "status": false,
  "message": "string",
  "result": {}
}
Response examples (500)
{
  "status": false,
  "message": "string",
  "result": {}
}