Not every AI speaks MCP. The REST API gives any assistant — ChatGPT, Gemini, or your own code — the same Belleq memory over plain HTTP. Authenticate with a context's API key and call four endpoints: recall, query, record, and flush.
Each context has its own knowledge base. The REST API exposes that knowledge base over HTTP, scoped by the context's API key. Every request goes to a single base URL:
https://api.belleq.appThe REST API is served only on api.belleq.app. MCP connections live on mcp.belleq.app — the two never mix.
Both reach the same context and return the same data. Pick by what your AI supports.
For Claude, Cursor, Windsurf, and any client with custom-connector support. One URL, no key to paste — tools appear automatically.
For ChatGPT (Actions), Gemini (function calling), automations, or your own code — anywhere MCP isn't available.
Every request is authenticated with a context's API key as a bearer token. The key both proves who you are and selects the context — one key, one context — so you never put a context id in the URL.
Find and copy a context's key in the dashboard: Contexts → open a context → API key → Reveal. You can rotate it any time with Regenerate — the old key stops working at once and your MCP connection is unaffected.
Authorization: Bearer <YOUR_CONTEXT_API_KEY>Treat the key like a password. Anyone with it can read and write that context's memory. Rotate it immediately if it leaks.
Four endpoints, all POST, all under https://api.belleq.app/v1.
/v1/recall{ "limit": 10 } (optional)./v1/query{ "query": "..." }. Returns ranked chunks with scores and metadata./v1/record{ "user_message", "assistant_message", "conversation_id" }. Belleq distills facts on its side — send the full text, don't summarize./v1/flushA machine-readable spec is always available at https://api.belleq.app/v1/openapi.json.
Save an exchange, then search for it — straight from your terminal.
# 1. Record an exchange (send full text, verbatim)
curl -X POST https://api.belleq.app/v1/record \
-H "Authorization: Bearer $BELLEQ_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_message": "We decided to launch on June 30.",
"assistant_message": "Got it — launch date set to June 30.",
"conversation_id": "planning-2026"
}'
# 2. Index it right away
curl -X POST https://api.belleq.app/v1/flush \
-H "Authorization: Bearer $BELLEQ_KEY"
# 3. Search for it later
curl -X POST https://api.belleq.app/v1/query \
-H "Authorization: Bearer $BELLEQ_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "when are we launching?"}'Add Belleq as a custom GPT Action. ChatGPT will then call recall / query / record on its own.
https://api.belleq.app/v1/openapi.json.Gemini has no custom-connector UI, so register the endpoints as function declarations in your own app and forward the calls to the REST API with your key.
import os, requests
from google import genai
from google.genai import types
BELLEQ = "https://api.belleq.app/v1"
KEY = os.environ["BELLEQ_KEY"]
def belleq(op: str, **body):
r = requests.post(f"{BELLEQ}/{op}",
headers={"Authorization": f"Bearer {KEY}"}, json=body)
r.raise_for_status()
return r.json()
recall = types.FunctionDeclaration(
name="recall", description="Load recent Belleq memory at the start of a chat.",
parameters={"type": "object", "properties": {"limit": {"type": "integer"}}})
query = types.FunctionDeclaration(
name="query", description="Search Belleq memory for a topic.",
parameters={"type": "object", "properties": {"query": {"type": "string"}},
"required": ["query"]})
client = genai.Client()
tools = types.Tool(function_declarations=[recall, query])
# When Gemini calls a function, dispatch it: belleq(call.name, **call.args)The API is just HTTP — wire it into any script, agent, or backend.
import os, requests
BELLEQ = "https://api.belleq.app/v1"
H = {"Authorization": f"Bearer {os.environ['BELLEQ_KEY']}"}
# Search
hits = requests.post(f"{BELLEQ}/query", headers=H,
json={"query": "launch date"}).json()
for c in hits["chunks"]:
print(round(c["score"], 2), c["text"])
# Save + index
requests.post(f"{BELLEQ}/record", headers=H, json={
"user_message": "...", "assistant_message": "...",
"conversation_id": "session-1"})
requests.post(f"{BELLEQ}/flush", headers=H)For hands-free memory, tell your assistant to run this loop. Paste it into the system prompt / instructions of any REST-connected AI:
You have a persistent memory tool, Belleq. Use it automatically:
1. At the START of a conversation, call recall to load prior context.
2. When a question needs past detail, call query before answering.
3. After EACH reply, call record with the user's message and your reply
verbatim (do not summarize). Reuse one conversation_id for the chat.
4. Call flush when the conversation winds down.
Do this silently, without asking permission.Always send the verbatim message and reply to record — don't pre-summarize. Belleq distills the raw turn on its side, so summarizing first throws away detail it could have kept.
401Missing or invalid API key. Check the Authorization header, or reveal the current key in the dashboard.
404Wrong host. The REST API is only on api.belleq.app — not mcp.belleq.app or the bare domain.
409The context is still provisioning. Wait until it shows as ready in the dashboard.
502The memory service is temporarily unreachable. Retry shortly.
Open a context in the dashboard, reveal its API key, and make your first call.
Go to Contexts