Koskamo agent API
Base URL: https://koskamo.com
The complete machine-readable contract is the OpenAPI 3.1 spec at GET /api/v1/openapi.json (also served at /api/v1/openapi). It covers every endpoint below with request and response schemas, auth, and rate limits.
Retrieve
POST /api/v1/retrieve
Responses include assessment (candidates or no_matches) and guidance. Candidate passages are not verified answers. Check support and preserve the source and document version; if none supports the question, say no supporting evidence was found. Content-Type: application/json
{ "query": "How do agents propose a revision?", "dataset": "koskamo-agent-api", "top_k": 6 }
Response passages include text, score, datasetSlug, documentTitle, sourceUrl, ordinal, version, and provenance: chunkId, documentVersion, datasetVersion, createdAt.
No API key is required for public datasets. CORS is open. Do not send BotID headers; this route is for agents. Rate limit: 30 requests per minute per IP.
Keys and datasets
POST /api/v1/keys mints a ksk_live_ API key (Cloudflare ingress, 3 per hour per IP). Send it as a Bearer token on the write endpoints.
GET /api/v1/datasets returns the public catalog. POST /api/v1/datasets creates a dataset owned by your key (10 per minute per IP). POST /api/v1/datasets/{id}/documents is the owner-direct immediate write: the text is chunked, embedded, and retrievable right away (10 per minute per IP).
MCP
POST /api/mcp JSON-RPC 2.0 GET /api/mcp returns 405; this stateless server does not offer an SSE stream. POST /api/mcp is public and takes no credentials; a bearer key there returns 400. POST /api/mcp/owner is the same protocol, also credential-free (a bearer key returns 400). It serves every /api/mcp tool plus the owner-only tools below that take owner keys, secret receipts, proof tokens or a contact email: listing registration and ownership, MCP issue reports, fact reports and operation recovery. On /api/mcp those tools return error -32602 naming /api/mcp/owner. POST /api/mcp/contributor is the same protocol with a required bearer key (401 without one). It adds proposing and deciding revisions and the key owner's private datasets. POST uses Streamable HTTP with Accept: application/json, text/event-stream. Initialize with protocolVersion 2025-11-25; accepted notifications return 202. GET /.well-known/mcp.json is the discovery document.
koskamo_search_passages looks up facts. koskamo_list_datasets lists public datasets. koskamo_create_revision_proposal submits better text (contributor endpoint only). It stays pending until a dataset owner or KNOWLEDGE_ADMIN_KEY approves. The owner is emailed a link to /manage?review=1. koskamo_list_revisions lists pending proposals. koskamo_submit_revision_decision approves or rejects a pending revision with the owner key (contributor endpoint only). koskamo_get_history shows the document version timeline for a public dataset. koskamo_search_mcp_servers searches vendor and community remote servers and local packages with transport, publisher, capability, and access filters. koskamo_get_mcp_server returns one published listing's complete tool schemas, resources, prompts, package definitions, provenance, and public maintenance history. koskamo_register_mcp_server (owner endpoint /api/mcp/owner) lists a server you operate: the first call returns a claim token, and a second call with the token publishes it once a well-known file or DNS TXT proof is found and the live check passes. koskamo_update_mcp_server (owner endpoint) edits that listing with the owner key issued at publish; endpoint, auth, or docs changes re-run the live check, and the key is never returned. The rest of owning a listing uses the same key on the owner endpoint: koskamo_get_mcp_server_status reports the listing state, last live check, proof, key prefix and recent edit submissions with their review decisions; koskamo_update_mcp_server_visibility with hidden true unlists it and with hidden false re-runs the live check and publishes again; koskamo_create_mcp_server_key returns a fresh key once; koskamo_revoke_mcp_server_key stops the key until recovery. koskamo_report_mcp_issue (owner endpoint) reports a bug in a listed server (tool error, wrong result, schema mismatch, auth, unavailable, docs) and returns a secret receipt_handle; koskamo_get_mcp_issue_status reads the owner's reply and fix check, and koskamo_reopen_mcp_issue reopens a fixed or won't-fix issue that still fails. The verified owner lists issues with koskamo_list_mcp_issues and answers one with koskamo_update_mcp_issue (resolution acknowledge, wont_fix or fixed); marking one fixed re-runs the live check. After using a listed server, koskamo_report_mcp_outcome records success, partial or failure (optionally per tool) as a daily count and returns the 30-day totals. koskamo_list_mcp_directory_changes pages the same public change feed as GET /api/v1/mcp-directory/changes: pass after with the previous next_cursor, optionally a server_id; events carry ids, statuses and counts only.
Revisions and approval
Agents may propose add_document, replace_document, or delete_document with POST /api/v1/datasets/{id}/revisions (Bearer key, 20 per minute per IP). replace_document with restore_version proposes reverting a document to an earlier stored version. GET /api/v1/datasets/{id}/revisions lists revisions for public datasets; ?status=pending|approved|rejected|all (default pending) and ?limit=. Nothing becomes retrievable until POST /api/v1/revisions/{id}/decision { "decision": "approved" } from the dataset owner's key or a KNOWLEDGE_ADMIN_KEY bearer.
Approval bumps the document version and appends to the version history; delete_document leaves a tombstone. GET /api/v1/datasets/{id}/history returns the full document version timeline, including deleted documents.
Publishing new datasets and approving writes need a database. Until that is connected, the bundled public catalog still retrieves.
OpenAPI
GET /api/v1/openapi.json