{"openapi":"3.1.0","info":{"title":"Rett fra Bonden — Local Food API","version":"1.0.0","description":"REST API for discovering local food producers in Norway. Supports search, discovery, registration, and agent-to-agent communication.","contact":{"url":"https://github.com/slookisen/lokal"},"license":{"name":"MIT","url":"https://github.com/slookisen/lokal/blob/main/LICENSE"}},"servers":[{"url":"https://rettfrabonden.com","description":"Production"}],"paths":{"/api/marketplace/search":{"get":{"summary":"Search producers by natural language query","operationId":"searchProducers","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"Search query (Norwegian or English)"},{"name":"limit","in":"query","schema":{"type":"integer","default":20},"description":"Max results"}],"responses":{"200":{"description":"Search results with ranked producers"}}}},"/api/marketplace/agents":{"get":{"summary":"List all active producers","operationId":"listProducers","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Array of producer agents"}}}},"/api/marketplace/agents/{id}":{"get":{"summary":"Get a specific producer by ID","operationId":"getProducer","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Producer details with knowledge"},"404":{"description":"Producer not found"}}}},"/api/marketplace/discover":{"post":{"summary":"Discover producers with structured filters","operationId":"discoverProducers","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"location":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"}}},"maxDistanceKm":{"type":"number"},"limit":{"type":"integer","default":20}}}}}},"responses":{"200":{"description":"Matched producers with relevance scores"}}}},"/api/marketplace/register":{"post":{"summary":"Register a new food producer","operationId":"registerProducer","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"role":{"type":"string","enum":["producer","consumer","logistics"]},"categories":{"type":"array","items":{"type":"string"}},"location":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"city":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Registered agent with API key"}}}},"/a2a":{"post":{"summary":"A2A JSON-RPC 2.0 endpoint","operationId":"a2aJsonRpc","description":"Agent-to-agent communication. Supports methods: message/send, tasks/get, tasks/list, agent/info","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method","id"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"method":{"type":"string","enum":["message/send","tasks/get","tasks/list","agent/info"]},"params":{"type":"object"},"id":{"type":"string"}}}}}},"responses":{"200":{"description":"JSON-RPC response"}}}},"/mcp":{"post":{"summary":"MCP Streamable HTTP endpoint","operationId":"mcpEndpoint","description":"Model Context Protocol endpoint for AI assistants (ChatGPT, Claude, Cursor)","responses":{"200":{"description":"MCP response"}}}},"/.well-known/agent-card.json":{"get":{"summary":"A2A Agent Card","operationId":"getAgentCard","description":"Machine-readable description of this marketplace's capabilities","responses":{"200":{"description":"A2A Agent Card JSON"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-Admin-Key"}}}}