Evalban API
One API for AI that understands, remembers and asks before it acts. It speaks the same request format as OpenAI's chat API, and adds memory, approvals and logging on top.
https://api.evalban.comQuick start
- Get your invite, then sign in to the Console and create an API key.
- Send your first request:
curl https://api.evalban.com/v1/chat \
-H "Authorization: Bearer $EVALBAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Hello!"}]}'
Or in JavaScript (Node 18+):
const res = await fetch("https://api.evalban.com/v1/chat", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.EVALBAN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ messages: [{ role: "user", content: "Hello!" }] }),
});
const data = await res.json();
console.log(data.choices[0].message.content);
Already use the OpenAI SDK? Point it at Evalban:
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.EVALBAN_API_KEY, baseURL: "https://api.evalban.com/v1" });
const r = await client.chat.completions.create({ model: "evalban-fast", messages: [{ role: "user", content: "Hello!" }] });
Authentication
Send your API key in the Authorization header on every request:
Authorization: Bearer evb_live_...
Keep keys on your server. Never put them in a website, mobile app or public repository. If a key leaks, revoke it in the Console and create a new one.
Chat
/v1/chat/completions works too, for OpenAI SDK compatibility.
Request body
| Field | Description |
|---|---|
messages | Required. Up to 50 messages, each { "role", "content" }. Roles: system, user, assistant, or tool (to report an action's result, with "name"). |
model | Optional. evalban-fast (default), evalban-smart, or openai/<model>. See Models. |
memory | Optional. A memory id like "customer-42". See Memory. |
actions | Optional. Actions the AI may request. See Actions & approvals. |
max_tokens | Optional. Length limit for the reply. Default 512, maximum 1024. |
temperature | Optional. 0 to 2. Lower is more focused. |
stream | Optional. true sends the reply word by word. See Streaming. |
Response
{
"id": "chatcmpl_evb_...",
"object": "chat.completion",
"model": "evalban-fast",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 41, "completion_tokens": 6, "total_tokens": 47 },
"evalban": { "requests_used": 12, "requests_limit": 500, "requests_remaining": 488 }
}
finish_reason is stop, tool_calls (the AI wants to run an action that doesn't need approval), or approval_required (an action is waiting for a person).
Models
| Model | Best for | Actions |
|---|---|---|
evalban-fast | Quick, low-cost answers. The default. | No |
evalban-smart | Harder reasoning and anything with actions. | Yes |
openai/<model> | Any OpenAI chat model, e.g. openai/gpt-4o-mini, billed to your own OpenAI account. Needs your OpenAI key. | Yes |
Streaming
Add "stream": true to show the reply as it's written, like a chat app. The response is a stream of server-sent events in the same format as OpenAI's streaming API, so existing OpenAI streaming code works unchanged.
curl -N https://api.evalban.com/v1/chat \
-H "Authorization: Bearer $EVALBAN_API_KEY" -H "Content-Type: application/json" \
-d '{"stream":true,"messages":[{"role":"user","content":"Write a short poem about forges"}]}'
Each event carries the next piece of text:
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":"Sparks"},"finish_reason":null}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" fly"},"finish_reason":null}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],
"usage":{...},"evalban":{"requests_used":13,"requests_limit":500,"requests_remaining":487}}
data: [DONE]
In JavaScript with the OpenAI SDK:
const stream = await client.chat.completions.create({
model: "evalban-fast", stream: true,
messages: [{ role: "user", content: "Hello!" }],
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content || "");
Streaming works with every model and with memory: the full reply is saved once the stream finishes. It doesn't support actions yet, so send those without stream. If something goes wrong mid-reply, you'll get an event with an error object before [DONE], and the request isn't counted.
Memory
Give a conversation a memory id and Evalban keeps track of it for you. Each request only needs the new message: Evalban adds the recent history (last 20 messages) and any saved facts automatically, and stores the new exchange.
curl https://api.evalban.com/v1/chat \
-H "Authorization: Bearer $EVALBAN_API_KEY" -H "Content-Type: application/json" \
-d '{"memory":"customer-42","messages":[{"role":"user","content":"My order number is 1187"}]}'
# Later, a new request with the same memory id:
-d '{"memory":"customer-42","messages":[{"role":"user","content":"Where is my order?"}]}'
Memory ids use letters, numbers and . _ : - (up to 100 characters). Use one per end user, customer or conversation. System messages aren't stored, so send your instructions with each request. Each memory keeps its newest 50 messages.
Saved facts
Facts are always included, however old the conversation gets. Use them for things that shouldn't be forgotten.
curl https://api.evalban.com/v1/memory/customer-42/facts \
-H "Authorization: Bearer $EVALBAN_API_KEY" -H "Content-Type: application/json" \
-d '{"fact":"Prefers to be contacted by email"}'
Returns the saved facts and recent messages.
Forgets everything in that memory, for example when a user asks you to delete their data.
Actions & approvals
Describe the actions your app can take. The AI decides when one is needed and fills in the details. Actions need a person's approval by default; set "requires_approval": false for safe ones like lookups. Use evalban-smart or an openai/ model.
{
"model": "evalban-smart",
"memory": "customer-42",
"messages": [{ "role": "user", "content": "Please refund order 1187" }],
"actions": [
{
"name": "refund_order",
"description": "Refund a customer's order",
"parameters": {
"type": "object",
"properties": { "order_id": { "type": "string" } },
"required": ["order_id"]
}
},
{ "name": "lookup_order", "description": "Look up an order's status", "requires_approval": false,
"parameters": { "type": "object", "properties": { "order_id": { "type": "string" } } } }
]
}
When approval is needed
The reply has finish_reason: "approval_required" and the pending approval:
"evalban": {
"approvals": [
{ "id": "6f1c...", "action": "refund_order", "arguments": { "order_id": "1187" }, "status": "pending" }
]
}
Show it to the right person in your app. When they decide, record it:
curl -X POST https://api.evalban.com/v1/approvals/6f1c.../approve \
-H "Authorization: Bearer $EVALBAN_API_KEY" -H "Content-Type: application/json" \
-d '{"note":"Approved by Sam"}'
Then run the action in your own code, and tell the AI how it went with a tool message so it can reply to the user:
{ "memory": "customer-42", "model": "evalban-smart",
"messages": [{ "role": "tool", "name": "refund_order", "content": "Refunded $42.00" }] }
Every decision is logged and shown in your Console. With a memory id, the decision is also added to the memory automatically. Each approval can be decided once.
Actions without approval
These come back as standard OpenAI-style tool_calls on the message, with finish_reason: "tool_calls". Run them and send the result as a tool message.
Your OpenAI key
Add your OpenAI key once in the Console. It's stored encrypted and never shown again. Then use any OpenAI chat model with the openai/ prefix:
{ "model": "openai/gpt-4o-mini", "messages": [{ "role": "user", "content": "Hello!" }] }
OpenAI bills you directly for these requests. Memory, actions, approvals and logs work the same as with Evalban models. Requests still count toward your monthly Evalban requests.
Local models (Ollama)
Run models on your own computer with Ollama, so they work offline and your prompts never leave the machine. The small evalban-local library adds Evalban memory and logging on top. Local requests show up in your Console and don't count toward your monthly limit.
- Install Ollama and download a model:
ollama pull llama3.2 - Download evalban-local.mjs into your project (Node 18+, no dependencies).
- Use it:
import { EvalbanLocal } from "./evalban-local.mjs";
const ai = new EvalbanLocal({ apiKey: process.env.EVALBAN_API_KEY });
const r = await ai.chat({
model: "llama3.2",
memory: "customer-42", // optional, same memory as the cloud API
messages: [{ role: "user", content: "Hello!" }],
onToken: (text) => process.stdout.write(text), // optional, stream the reply
});
console.log(r.choices[0].message.content);
Offline? Chat keeps working. Logs and memory updates are kept and sent automatically the next time Evalban is reachable (or call ai.flush()). Without an API key it runs fully local and sends nothing.
If Ollama isn't running you'll get a clear error asking you to start it with ollama serve; a missing model tells you which ollama pull to run. Actions and approvals are cloud-only for now.
Logging a local request yourself? POST /v1/local/report with { "model": "llama3.2", "prompt_tokens": 20, "completion_tokens": 40, "latency_ms": 900 }. To add messages to a memory directly, POST /v1/memory/:id/messages with { "messages": [...] }.
Errors
Errors use standard HTTP status codes with a JSON body:
{ "error": { "code": "monthly_limit_reached", "message": "You've used all 500 free requests this month..." } }
| Status | Code | What to do |
|---|---|---|
| 400 | invalid_request | Check the message: it says which field is wrong. |
| 400 | provider_key_missing / provider_key_invalid | Add or update your OpenAI key in the Console. |
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 404 | approval_not_found | Check the approval id. |
| 409 | already_decided | The approval was already approved or rejected. |
| 429 | monthly_limit_reached | Your plan's requests are used up until the 1st (UTC). Upgrade to Pro in the Console for more. |
| 429 | provider_rate_limited | Your OpenAI account is over its limit or quota. |
| 502 | model_error | The model didn't answer. Retry after a moment. |
Limits
| Limit | Value |
|---|---|
| Free plan | 500 successful requests a month, reset on the 1st (UTC) |
| Pro plan | 10,000 successful requests a month ($25/month, upgrade in the Console) |
| Messages per request | 50, up to 32,000 characters in total |
| Reply length | Up to 1,024 tokens (max_tokens) |
| Actions per request | 16 |
| Memory | Newest 50 messages and up to 100 facts per memory id |
| API keys | 10 active keys per account |
| Streaming | Available on all models; not with actions yet |
Usage alerts
We email the account's address when you reach 80% and 100% of your monthly requests, at most once each per month, so you're never surprised by monthly_limit_reached. Local (Ollama) requests don't count.
Questions or need higher limits? Email hello@evalban.com.