Bringing the world's first chatbot (1966) to the modern LLM ecosystem.
ElizAPI wraps the classic ELIZA chatbot algorithm in a modern, OpenAI-compatible /v1/chat/completions REST API. This allows you to drop ELIZA into any modern LLM tooling, framework (like LangChain or LlamaIndex), or UI that expects an OpenAI endpoint.
- Environment: Cloudflare Workers (Edge Serverless)
- Language: TypeScript
- Engine:
elizabot(Node.js port of the original ELIZA algorithm) - Protocol: REST API (OpenAI API compatibility layer)
To maintain ELIZA's "memory" (e.g., "Earlier you mentioned..."), you must send the entire conversation history in the messages array for every request. Since the server is stateless, it replays previous messages to rebuild ELIZA's internal state.
curl -X POST https://elizapi.erlk0nig.workers.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "elizabot",
"messages": [
{"role": "user", "content": "I am feeling stressed."},
{"role": "assistant", "content": "Why do you say you are feeling stressed?"},
{"role": "user", "content": "Because of my work."}
]
}'import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'not-needed',
baseURL: 'https://elizapi.erlk0nig.workers.dev/v1',
});
// To keep ELIZA's memory, always include previous messages
const response = await openai.chat.completions.create({
model: 'elizabot',
messages: [
{ role: 'user', content: 'I am feeling stressed.' },
{ role: 'assistant', content: 'Why do you say you are feeling stressed?' },
{ role: 'user', content: 'Because of my work.' }
],
});
console.log(response.choices[0].message.content);from openai import OpenAI
client = OpenAI(
api_key="not-needed",
base_url="https://elizapi.erlk0nig.workers.dev/v1"
)
# To keep ELIZA's memory, always include previous messages
response = client.chat.completions.create(
model="elizabot",
messages=[
{"role": "user", "content": "I am feeling stressed."},
{"role": "assistant", "content": "Why do you say you are feeling stressed?"},
{"role": "user", "content": "Because of my work."}
]
)
print(response.choices[0].message.content)If you want to run your own instance of ElizAPI on your Cloudflare account:
-
Clone the repository:
git clone https://github.com/computerphilosopher/elizapi.git cd elizapi -
Install dependencies:
npm install
-
Deploy to Cloudflare:
npm run deploy
MIT