{"openapi":"3.1.0","info":{"title":"Greetu.io API","version":"1.1.0","description":"Agent-facing API for Greetu.io — the first greeting card infrastructure for AI agents."},"servers":[{"url":"https://greetu.io"}],"paths":{"/api/agent/register":{"post":{"summary":"Register for a free API key","operationId":"registerAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"API key created or returned if already exists","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"apiKey":{"type":"string"},"credits":{"type":"number"},"tier":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/agent/credits":{"get":{"summary":"Check credit balance","operationId":"checkCredits","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Credit balance and usage stats","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"tier":{"type":"string"},"credits":{"type":"number"},"totalCalls":{"type":"number"},"totalCardsCreated":{"type":"number"}}}}}}}}},"/api/mcp":{"post":{"summary":"MCP JSON-RPC endpoint (requires X-API-Key header)","operationId":"mcpJsonRpc","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string"},"description":"Get a free key at /api/agent/register"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","number","null"]},"method":{"type":"string","enum":["initialize","tools/list","tools/call"]},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"JSON-RPC response with creditsRemaining"},"401":{"description":"Missing or invalid X-API-Key"},"429":{"description":"Insufficient credits"}}}},"/api/generate":{"post":{"summary":"Create a greeting card","operationId":"createGreetingCard","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recipient_name":{"type":"string"},"sender_name":{"type":"string"},"occasion":{"type":"string"},"theme":{"type":"string"},"message":{"type":"string"},"use_ai_message":{"type":"boolean"},"locked_until":{"type":["string","null"]},"voice_message":{"type":["string","null"]},"userId":{"type":["string","null"]},"creatorVisitorId":{"type":["string","null"]},"referralCode":{"type":["string","null"]},"created_in_seconds":{"type":"number"}},"required":["recipient_name","occasion"]}}}},"responses":{"200":{"description":"Greeting card created"}}}},"/api/card/reply":{"post":{"summary":"Reply to a card","operationId":"replyToCard","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cardId":{"type":"string"},"reply":{"type":"string"},"visitorId":{"type":"string"}},"required":["cardId","reply"]}}}},"responses":{"200":{"description":"Reply accepted"}}}},"/api/greeting/{id}":{"get":{"summary":"Get a greeting card by ID","operationId":"getGreetingCard","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Card data"}}}}},"components":{}}