Table of Contents
Botsonic, a Writesonic product, offers ChatGPT 4 model integration for chatbot creation. While powerful, it requires a business plan for API access. When using the API, be aware of outdated documentation. The correct implementation involves additional parameters like chat_id and chat_history in your JSON payload for successful requests.
Botsonic is a great product of Writesonic. I used it to create a chatbot using ChatGPT 4 model, and then request API with Python. However, there are some obstacles you may need to overcome.
Business Plan
On the pricing page, you can see that the free and plus plans are unable to access the API. You need to upgrade to the business plan.

The Right Way To Send A Request
Perhaps Botsonic evolves too fast, so some documents are outdated. For example, when you generate a Rest API, get the Endpoint and API token, and then click “View docs” button to redirect to the documents.

You will get a sample code. Everything seems perfect.

However, when you run the code in your Python editor, you will get an 422 error message:
{"detail":"Invalid Token"} <Response [422]> {"detail":[{"loc":["body"],"msg":"field required","type":"value_error.missing"}]}The solution is in the next tab, API Reference. On this page, you can find some required parameters that are not mentioned in the sample code. For example, chat_id and chat_history are required, you need to add them to the JSON.

Here is the complete Python code and response:
import uuid
import requests
endpoint = "your endpoint"
token = "your token"
payload = {
"input_text": "How to develop these skills? please answer.",
"chat_id": str(uuid.uuid4()),
"chat_history": [
{
"sent": True,
"sources": [
{
"newKey": "New Value",
"newKey2": "New Value"
}
],
"message": "previous message"
}
]
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"token": token
}
response = requests.post(endpoint, json=payload, headers=headers)
print(response)
# <Response [200]>
print(response.text)
# <Response [200]>
# {"answer":"To develop skills like humor, cleverness, and extensive knowledge for live streaming, engage in diverse reading, practice improvisation, study successful streamers, participate in workshops or courses on communication and comedy, and consistently interact with your audience to refine your approach based on feedback.","sources":[],"chat_history":[{"message":"How to develop these skills? please answer in English.","sent":true,"sources":null,"generated_images":null},{"message":"To develop skills like humor, cleverness, and extensive knowledge for live streaming, engage in diverse reading, practice improvisation, study successful streamers, participate in workshops or courses on communication and comedy, and consistently interact with your audience to refine your approach based on feedback.","sent":false,"sources":[],"generated_images":null}],"generated_images":null,"follow_up_questions":["What resources are needed to develop skills?","What is the process to develop skills?"]}






References: Cryptologic Casino Auszahlung
References: Jackpot Casino Erfahrungen jobsdriver.eu
References: Malina Casino Test
References: Bet.Bet Casino Login
References: Goldstrike Casino Bonus
References: Candy 96 slot
References: Candy96 mirror link guilairo520.gain.tw
References: Candy96 register
References: Pelican Casino Einzahlung
References: Lollybet Casino Mobile amarokforum.ru