Skip to content

API reference

All paths below are relative to the API base: http://localhost:8000/api behind the Compose nginx, or the direct API port without /api. The live schema is at {api}/openapi.json and Swagger UI at {api}/docs.

Send X-API-Key: <key>. OIDC bearer tokens (Authorization: Bearer <jwt>) are accepted when OIDC_ENABLED=true; a bearer wins over a key.

SituationResult
No key, auth open (AUTH_REQUIRED=false, default)Anonymous caller, no namespace limits.
No key, auth required401.
Invalid, revoked or expired key401, in both modes.
Namespace not allowed for the key403.

Namespace rules are in Namespaces and keys.

Method and pathDoes
POST /v1/memory-cardsCreate an idea. Body: {meta: {name, namespace, tags, when_to_use}, content: {...}}. 201 with entity_id, version_id, version_number, etag. No duplicate check.
GET /v1/memory-cards?namespace=&limit=&cursor=List, cursor-paginated (limit up to 200). Without namespace, a key sees its owner namespace unless it has read:any.
GET /v1/memory-cards/{id}Current version.
PUT /v1/memory-cards/{id}New version. Replaces the whole content. If-Match: <etag> gives 412 on a concurrent change. Optional change_summary.
DELETE /v1/memory-cards/{id}Soft delete. Prefer status: "archived".
GET /v1/memory-cards/{id}/versionsVersion history.
GET /v1/memory-cards/{id}/versions/{version_id}One version.
GET /v1/memory_cards/duplicates?threshold=0.95&namespace=Near-duplicate pairs by embedding cosine similarity. 503 without vector search.

Only content.status == "active" ideas are delivered by retrieve. See Ideas for fields.

Same shape at /v1/tools (POST, GET list, GET/PUT/DELETE by id). content is validated: tool_key, name, runtime and status are required; description, input_schema, output_schema, implementation_ref, implementation_hash, tags and origin are optional.

POST /v1/retrieve

FieldNotes
modeevolution or catalog. Required.
namespaceRequired.
run_id, candidate_idRequired in evolution; together they identify one mutation decision.
task_keyOptional. In catalog: return this task’s chains by fitness. In evolution: enables task-level experience; one run cannot change it (422).
context.task_descriptionRequired. 1–2 sentences, English. Used for search when there is no focus.
context.focusWhat to improve: a string or a list of up to 4 weak spots. The main search signal in evolution.
context.extraFree-form; string values join the query.
kIdeas to return; default RETRIEVE_DEFAULT_K (3).
exclude_idsNever returned. In catalog, pass what you already have to get more.

Response: {"items": [...], "hints": [...], "run_url": ...}. Each item has entity_type (memory_card, tool, chain; skip unknown types), id, relevance (null for padding and task chains) and content. Catalog items also carry efficacy; evolution items do not. run_url is the signed live page in evolution, null in catalog. hints in catalog may contain {"kind": "more", "remaining": N, "label": ...}.

An empty items is a normal answer (control slate, or nothing relevant). Repeating an evolution call with the same run_id + candidate_id returns the recorded slate.

POST /v1/outcome, discriminated by kind.

Mutation:

FieldNotes
run_id, candidate_idThe retrieve that delivered the slate.
deltaChild score minus parent score; null for an invalid child.
parent_scoreOptional; enables range-relative strength.
metricOptional {name, higher_is_better=true, lower_bound, upper_bound, min_delta=0}.
cited_idea_idsIdeas from this slate that were really applied.
changeOptional {diff, rationale} for extraction. Truncated to 20000 / 4000 characters.

Response 201 {"recorded": true, "created": true}, or 200 with created: false on an exact repeat. A mutation outcome takes its namespace and task from the matching retrieve. Without a prior retrieve it is accepted but has no scope and does not rate ideas.

Run:

FieldNotes
namespace, task_key, run_idRequired.
best_chainThe final solution as JSON. Stored as a chain tagged task:<task_key>.
best_fitnessIts score.
metricOptional, as above.
path_idea_idsIdeas on the best chain’s lineage.

Response 201 {"chain_id": "..."}, 200 on repeat.

Method and pathAuthDoes
GET /v1/ideal/run/{ns}/{run}/linkKey, read on ns{run_url, data_url} of any run in the namespace.
GET /v1/ideal/run/{ns}/{run}?sig=SignatureLive HTML page: radar, best score, arms, feed. Polls every 5 s.
GET /v1/ideal/run/{ns}/{run}/data?sig=SignatureThe page data as JSON: run, curve, radar, radar_sectors, mutations.
POST/DELETE /v1/ideal/run/{ns}/{run}/force?sig=Signature{"idea_id": ...}: force the idea into every next slate until cited, or stop.
POST /v1/ideal/run/{ns}/{run}/propose?sig=Signature{"task_description": ...}: draft candidate ideas with translations for display. 503 without a lake LLM.
POST /v1/ideal/run/{ns}/{run}/ideas?sig=Signature{"ideas": [{name, description, when_to_use, tags}]} (1–10): create and force them. Exact duplicates are returned, not created.

Signature routes return 404 for a bad signature and 409 for a finished run (for propose and ideas).

Used by the bundled web UI and by MAESTRO. Not a stable client contract.

Method and pathDoes
GET /v1/ideal/overview?namespace=Totals (delivered vs control), tasks, ideas with gain_rate, strength, efficacy, runs with status running/stalled/finished.
GET /v1/ideal/graph?namespace=&limit=Nodes and edges, see the graph.
GET /v1/ideal/runs/{run_id}/mutationsOne run’s mutations in order.
GET /v1/ideal/seed/statusWhether the lake LLM is configured.
POST /v1/ideal/seed/propose{namespace, task_description, k=6} (k ≤ 20): candidates with keep/rewrite/drop verdicts. Writes nothing.
GET/PUT /v1/ideal/llmAvailable models and the chosen main and fast models; a stored choice overrides the environment.

No key needed, even when auth is required:

PathContent
GET /v1/ideal/AGENTS.mdHarness-agnostic agent guide (Markdown).
GET /v1/ideal/skill/SKILL.md, GET /v1/ideal/skill/scripts/lake.pyThe seeding skill.
Method and pathScopeDoes
GET /v1/auth/meAny real key{key_id, owner, namespaces, scopes}. 401 for anonymous.
POST /v1/admin/keysadmin:keys{owner, label, namespaces, scopes, expires_days} → key metadata and plaintext.
GET /v1/admin/keysadmin:keysAll keys with last_used_at, request_count, viewable, namespace_activity.
GET /v1/admin/keys/{key_id}/plaintextadmin:keys{plaintext}; 404 if the key was issued without encrypted storage.
PATCH /v1/admin/keys/{key_id}admin:keys{label, namespaces}.
POST /v1/admin/keys/{key_id}/revokeadmin:keysRevoke now.
GET/PUT /v1/admin/settingsadmin:keys{auth_required}; overrides AUTH_REQUIRED.

The API serves stateless Streamable HTTP MCP at {api}/mcp, with the same X-API-Key and namespace rules.

Terminal window
claude mcp add --transport http ideal {api}/mcp --header "X-API-Key: <key>"
ToolDoes
ideal_namespacesNamespaces this key can read, with entity counts.
ideal_catalogCompact chains, ideas and tools for a task.
ideal_start_runA readable run id and its signed run_url.
ideal_ideasNext candidate id (m<N>) and the evolution slate.
ideal_report_changeParent and new scores (null for invalid), metric, applied idea ids from that slate, rationale, optional diff.
ideal_report_runThe complete best solution and its score.

Resources: ideal://AGENTS.md, ideal://skill/SKILL.md, ideal://skill/scripts/lake.py.

IdeaL shares the API with the rest of GigaEvo Memory: chains, steps, agents, agent skills, versions and channels, unified search, SSE events, /health and /metrics. Those are outside this section.