{"openapi":"3.1.0","info":{"title":"Supportsheep Agent API","summary":"Agent-facing signup and MCP endpoints.","description":"Redeem an invite code to mint a one-time API key, then call the remote MCP server with `Authorization: Bearer <key>`.","version":"1.0.0"},"servers":[{"url":"https://supportsheep.com"}],"tags":[{"name":"signup","description":"Code-gated agent account provisioning."},{"name":"mcp","description":"Streamable HTTP MCP transport."}],"paths":{"/api/v1/agent/signup":{"post":{"operationId":"agentSignup","tags":["signup"],"summary":"Redeem an invite code and mint an API key","description":"Public, code-gated signup. The invite code is one-use. The API key is returned once in plaintext and stored only as a SHA-256 hash.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupRequest"},"example":{"code":"invite-code","email":"agent@example.com","name":"Support agent","sandbox":false}}}},"responses":{"201":{"description":"Account provisioned. Store `apiKey` immediately.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupResponse"}}}},"400":{"description":"Unknown invite code or invalid body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Invite code existed but is expired or already used.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Back off and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/mcp":{"post":{"operationId":"mcpJsonRpc","tags":["mcp"],"summary":"Call the remote MCP server","description":"Streamable HTTP transport. POST JSON-RPC messages with a bearer API key from POST /api/v1/agent/signup. GET is SSE; DELETE closes a session.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpJsonRpcRequest"},"example":{"jsonrpc":"2.0","id":1,"method":"tools/list"}}}},"responses":{"200":{"description":"JSON-RPC response from the MCP server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpJsonRpcResponse"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"MCP request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Obtain a key from https://supportsheep.com/api/v1/agent/signup. It is shown once."}},"schemas":{"AgentSignupRequest":{"type":"object","additionalProperties":false,"required":["code","email"],"properties":{"code":{"type":"string","minLength":1,"maxLength":100,"description":"One-use invite code from a Supportsheep admin."},"email":{"type":"string","format":"email"},"name":{"type":"string","minLength":1,"maxLength":200},"referralSource":{"type":"string","maxLength":200,"description":"Optional signup attribution."},"sandbox":{"type":"boolean","description":"When true, mint a sandbox key. Mutating MCP tools simulate success and perform no real side effects. Read tools still work against the sandbox account."}}},"AgentSignupResponse":{"type":"object","additionalProperties":false,"required":["apiKey","keyPreview","blogId","userId","role","usage","sandbox"],"properties":{"apiKey":{"type":"string","description":"Plaintext API key. Shown once."},"keyPreview":{"type":"string"},"blogId":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string"},"usage":{"type":"string"},"sandbox":{"type":"boolean","description":"True when the minted key is sandbox-flagged. Mutating MCP tools will simulate."}}},"McpJsonRpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"null"}]},"method":{"type":"string"},"params":{"type":"object","additionalProperties":true}}},"McpJsonRpcResponse":{"type":"object","required":["jsonrpc"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"null"}]},"result":{"type":"object","additionalProperties":true},"error":{"type":"object","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}