The AI Chatbot Creator API provides a set of endpoints to manage user authentication, process URLs to extract text content, interact with the AI chatbot, and manage API keys for chatbot integration. This documentation outlines the available endpoints, request/response formats, and error handling.
All API endpoints require authentication. Users must register and log in to obtain a session token, which should be included in the request headers for authenticated endpoints.
Endpoint: POST /register
Description: Register a new user.
Request Body:
{
"email": "[email protected]",
"password": "secure_password"
}
Response:
{
"message": "User registered successfully"
}
Endpoint: POST /login
Description: Log in an existing user.
Request Body:
{
"email": "[email protected]",
"password": "secure_password"
}
Response:
{
"message": "Logged in successfully"
}
Endpoint: POST /logout
Description: Log out the current user.
Response:
{
"message": "Logged out successfully"
}
Endpoint: POST /process_url
Description: Process a URL to extract text content and generate an API key for chatbot integration.
Request Body:
{
"url": "https://example.com"
}
Response:
{
"message": "Processing complete",
"api_key": "generated_api_key",
"integration_code": "<script src='...'></script>"
}
Endpoint: POST /chat
Description: Interact with the AI chatbot.
Request Body:
{
"input": "Hello, how are you?",
"api_key": "your_api_key"
}
Response:
{
"response": "I'm doing well, thank you! How can I assist you today?"
}
Endpoint: GET /user/api_keys
Description: Get all API keys for the current user.
Response:
{
"api_keys": ["key1", "key2"]
}
Endpoint: POST /delete_api_key
Description: Delete an API key.
Request Body:
{
"api_key": "key_to_delete"
}
Response:
{
"message": "API key deleted successfully"
}
Endpoint: GET /chatbot-design
Description: Get the chatbot design HTML.
Query Parameter:
api_key=your_api_key
Response:
<div id="ai-chatbot">...</div>
Endpoint: GET /test_together_api
Description: Test the connection to the Together API.
Response:
Together API connection successful
The API uses standard HTTP status codes to indicate the success or failure of a request. Common status codes include:
200 OK
: The request was successful.201 Created
: The resource was successfully created.400 Bad Request
: The request was invalid or malformed.401 Unauthorized
: Authentication failed or user does not have permissions for the requested operation.404 Not Found
: The requested resource was not found.500 Internal Server Error
: An error occurred on the server.
Error responses will include a JSON object with an error
key describing the issue:
{
"error": "Invalid API key"
}
To prevent abuse and ensure fair usage, the API implements rate limiting. The default limits are set to 2000 requests per day and 1000 requests per hour. Exceeding these limits will result in a 429 Too Many Requests
status code.
The AI Chatbot Creator API offers a robust set of endpoints to manage user accounts, process URLs, interact with AI chatbots, and manage API keys. By following this documentation, developers can integrate the API into their applications to create, deploy, and manage AI-powered chatbots seamlessly. make this in html css js