{"openapi":"3.1.0","info":{"title":"Omnimatch Agents API","version":"0.1.0","description":"Search, memories, and chat for your Omnimatch Agents — including sending an agent a message and reading its reply. Authenticate with an API key: `Authorization: Bearer oma_…`."},"servers":[{"url":"https://omnimatch.ai"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"oma_*"}}},"paths":{"/api/agents":{"get":{"summary":"List available agents","responses":{"200":{"description":"OK"}}}},"/api/agents/{agentId}/search":{"post":{"summary":"Run a search via the agent's datasource","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string"},"numResults":{"type":"integer"},"sourceId":{"type":"string","description":"Search one of the agent's sources by id; omit for the agent's default."},"fromYear":{"type":"integer","description":"Only results published in this year or later."},"toYear":{"type":"integer","description":"Only results published in this year or earlier."}}}}}},"responses":{"200":{"description":"Search results"},"402":{"description":"No subscription"}}}},"/api/agents/{agentId}/memories":{"get":{"summary":"List remembered facts","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"post":{"summary":"Add a memory","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"}}}},"/api/agents/{agentId}/favourites":{"get":{"summary":"List or search favourites","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Optional keywords to search favourites."}],"responses":{"200":{"description":"OK"}}},"post":{"summary":"Save a favourite","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["card"],"properties":{"card":{"type":"object"},"threadId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"}}}},"/api/agents/{agentId}/favourites/{cardId}":{"delete":{"summary":"Remove a favourite","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}},{"name":"cardId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/api/agents/{agentId}/threads":{"get":{"summary":"List chat threads","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"post":{"summary":"Start a new chat thread","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"}}}},"/api/agents/{agentId}/threads/{threadId}/messages":{"get":{"summary":"Read a thread's messages","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}},{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"post":{"summary":"Send a message and run a turn","description":"Answers inline when the agent finishes quickly. A research turn usually takes longer than one HTTP request should wait, so 202 is the normal reply, not an error: the turn keeps running and the answer appears at GET on this same path.","parameters":[{"name":"agentId","in":"path","required":true,"description":"Agent id, as returned by GET /api/agents.","schema":{"type":"string"}},{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","maxLength":8000}}}}}},"responses":{"200":{"description":"The agent replied within the wait."},"202":{"description":"Still working. Poll GET on this path for the reply."}}}}}}