Skip to content

Create and train a chatbot

post/create-chatbot
Workspace key

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 body

Sending 1 of 8 fields
Required
modelstring
The model the chatbot uses:
  • For training with your own data: custom-data-upload
  • For human medical questions: medical-chat-human
  • For veterinary medical questions: medical-chat-vet
  • For a custom model: custom-model
There is no default; a missing or unknown value is rejected with a 400. For the medical models and the custom model, sourceText, urlsToScrape, products and qAndAs are not used, though urlsToScrape must still contain valid URLs and products must still be an array.

Only these fields are sent (application/json).

Try it · POST /create-chatbot
curl 'https://api.chat-data.com/api/v2/create-chatbot' \  -H "Authorization: Bearer $CHAT_DATA_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "model": "custom-data-upload"}'
Loading…

Responses

The chatbot was created. Training on the provided data runs in the background; poll GET /chatbot/status/{chatbotId} for progress.

Content type: application/json

FieldDescription
chatbotIdstringThe unique identifier allocated to the chatbot. Use this ID in API calls about this chatbot.
consumedCharactersnumberThe number of training characters charged by this call. Websites are not counted here; they are charged when they are crawled.
remainingCharactersnumberThe number of training characters that remain available in your account. As long as the balance is positive, even by a single character, a training run proceeds and is limited only by the per-chatbot training character limit.
dataSourcesarray of objectAll data sources of the chatbot after this call. Newly added websites show 0 characters until they have been crawled. In the retrain-chatbot response, Q&A sources are listed with their question, answer and folder instead of a character count.
dataSources[].namestringThe name of the document, the product ID or the URL of the website. Absent for plain text and Q&As.
dataSources[].charactersnumberThe total number of characters in this data source.
dataSources[].questionstringThe question of a q&a source. Only in the retrain-chatbot response.
dataSources[].answerstringThe answer of a q&a source. Only in the retrain-chatbot response.
dataSources[].folderstringThe folder of a q&a source, when it has one. Only in the retrain-chatbot response.
dataSources[].typestringThe type of the data source (for example website, text, product or q&a).
statusstringOne of: success.

Example

{  "chatbotId": "6650f1c2a9e4b83d2c7a1f05",  "consumedCharacters": 156,  "remainingCharacters": 999844,  "dataSources": [    {      "characters": 156,      "type": "text"    },    {      "name": "https://www.example.com/help/shipping",      "characters": 0,      "type": "website"    }  ],  "status": "success"}

Last updated October 14, 2026