Create and train a chatbot
Create a chatbot using one of our medical chat models, your own uploaded data, or a custom model. model is required; a request without a valid model is rejected with a 400.
Available models:
- custom-data-upload: For training with your own data using OpenAI GPT models including GPT 5.6 Sol, GPT 5.6 Terra, and GPT 5.6 Luna; Anthropic Claude models including Claude Opus 5 and Claude Sonnet 5; Google Gemini models including Gemini 3.7 Flash and Gemini 3.5 Flash Lite; plus earlier supported models.
- medical-chat-human: For human medical questions
- medical-chat-vet: For veterinary medical questions
- custom-model: For using a custom model
For the custom-data-upload model, you can provide training data using sourceText, urlsToScrape, products or qAndAs. Other models do not use these fields, but urlsToScrape must still contain valid URLs and products must still be an array.
For the custom-model model, customBackend is required and bearer is optional. Chat Data sends a test request to the backend first and creates the chatbot only if the backend answers as expected.
You can poll the status of the training with GET /chatbot/status/{chatbotId} at an interval of 10 seconds. Training generally takes 1-2 minutes, depending on the length of the provided text or websites.
Note: The training data is subject to character limits based on your plan.
This operation requires a workspace API key; chatbot-scoped keys get a 403.
Request
- Base URL: https://api.chat-data.com/api/v2
- URL: https://api.chat-data.com/api/v2/create-chatbot
- Auth: HTTP bearer
Request body
Example request
{
"chatbotName": "Support Bot",
"sourceText": "Our support team is available Monday to Friday, 9am to 6pm EST. Outside these hours you can email support@example.com and we'll reply the next business day.",
"urlsToScrape": [
"https://www.example.com/help/shipping",
"https://www.example.com/help/returns"
],
"products": [
{
"id": "shopify_1234567",
"information": {
"id": "shopify_1234567",
"name": "Fleece Drawstring Joggers",
"color": "white"
}
}
],
"qAndAs": [
{
"question": "Do you ship internationally?",
"answer": "Yes, we ship to over 40 countries. International orders usually arrive within 7-14 business days."
}
],
"customBackend": "https://bot.example.com/v1/chat",
"bearer": "cb_7d3f9a2e5c81b4f0",
"model": "custom-data-upload"
}Response
The chatbot was created. Training on the provided data runs in the background; poll GET /chatbot/status/{chatbotId} for progress.
Example response
{
"chatbotId": "6650f1c2a9e4b83d2c7a1f05",
"consumedCharacters": 156,
"remainingCharacters": 999844,
"dataSources": [
{
"characters": 156,
"type": "text"
},
{
"name": "https://www.example.com/help/shipping",
"characters": 0,
"type": "website"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.