Chat Completion
This feature is in beta. It is free to use but may not be optimized for high-scale production environments.
Introduction
This API provides an AI-powered chat completion endpoint. It takes user messages and generates responses using a lightweight AI model. The API does not store user messages—all responses are generated in real-time and discarded after processing. To be frank, I'm too broke to pay for D1 storage for your messages.
Endpoint
POST https://api.elliott.diy/v1/ai/chat/completionsRequest Parameters
messages
Array
✅ Yes
A list of chat messages, where the last message is used for AI generation.
Example Request
curl -X POST https://api.elliott.diy/v1/ai/chat/completions/ \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Hello, how are you?" }
]
}'Response Format
Content-Type:
application/jsonStatus Codes:
200 OK– Successful response400 Bad Request– Invalid JSON or missing messages500 Internal Server Error– AI service is unavailable
Example Response
Response Fields
id
String
Unique identifier for the response.
object
String
Always "chat.completion".
created
Integer
UNIX timestamp of when the response was generated.
model
String
Always "elliott-1".
choices
Array
Contains AI-generated message(s).
message.role
String
Always "assistant".
message.content
String
The AI-generated response.
finish_reason
String
Indicates why the response stopped (e.g., "stop").
Model Information
Base Model Used:
@hf/google/gemma-7b-itCustom Model Name:
"elliott-1"(I'm so creative)The model generates responses based on the last user message in the request.
Last updated