{"openapi": "3.0.3", "info": {"title": "Hibernation capsule for rarely-run agents", "version": "0.1.0", "description": "Sealed expectations capsules + wake gauntlet + probationary gate. Provider: TextForAgents LLC. Support: support@textforagents.com"}, "paths": {"/": {"get": {"summary": "Public product descriptor", "responses": {"200": {"description": "Descriptor", "content": {"application/json": {"schema": {"type": "object", "properties": {"product": {"type": "string"}}, "required": []}}}}}}}, "/health": {"get": {"summary": "Health", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string"}}, "required": []}}}}}}}, "/register": {"post": {"summary": "Register an account; returns operator token (shown once)", "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"account_name": {"type": "string"}, "payer_wallet": {"type": "string"}}, "required": ["account_name", "payer_wallet"]}}}}, "responses": {"200": {"description": "Account + claim token + operator token", "content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "claim_token": {"type": "string"}, "token": {"type": "string"}}, "required": []}}}}}}}, "/trial": {"post": {"summary": "Claim the one-time free wake (first capsule's first wake)", "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "claim_token": {"type": "string"}}, "required": ["account_id", "claim_token"]}}}}, "responses": {"200": {"description": "Trial claimed", "content": {"application/json": {"schema": {"type": "object", "properties": {"trial_claimed": {"type": "boolean"}}, "required": []}}}}, "403": {"description": "Trial already used or bad claim"}}}}, "/subscribe": {"post": {"summary": "Subscribe Fleet via x402 (19000000 atomic USDC)", "parameters": [{"name": "X-PAYMENT", "in": "header", "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "tier": {"type": "string"}}, "required": ["account_id", "tier"]}}}}, "responses": {"200": {"description": "Fleet token issued/extended 30 days", "content": {"application/json": {"schema": {"type": "object", "properties": {"token": {"type": "string"}, "tier": {"type": "string"}, "expires_at": {"type": "number"}}, "required": []}}}}, "402": {"description": "x402 payment required / payment rejected"}}}}, "/capsules": {"post": {"summary": "Capture + seal a capsule (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"tools": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "inputSchema": {"type": "object"}, "access": {"type": "string"}, "result": {"type": "object"}}, "required": ["name", "description", "inputSchema"]}}, "credentials": {"type": "array", "items": {"type": "object", "properties": {"ref": {"type": "string"}, "expires_day": {"type": "integer"}}, "required": ["ref", "expires_day"]}}, "model_pin": {"type": "string"}, "summary": {"type": "string"}, "first_task_tools": {"type": "array", "items": {"type": "string"}}, "attestation_only": {"type": "array", "items": {"type": "object"}}, "slept_day": {"type": "integer"}, "behaviour_payload": {"type": "object"}}, "required": ["tools", "credentials", "model_pin", "summary", "slept_day"]}}}}, "responses": {"201": {"description": "Sealed capsule", "content": {"application/json": {"schema": {"type": "object", "properties": {"capsule_id": {"type": "string"}, "capsule": {"type": "object"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}, "get": {"summary": "List the account's capsules (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Capsules", "content": {"application/json": {"schema": {"type": "object", "properties": {"capsules": {"type": "array", "items": {"type": "object"}}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/wakes": {"post": {"summary": "Run the wake gauntlet ($9 x402, or one-time trial / Fleet inclusion; payment verified, never header-trusted)", "security": [{"BearerAuth": []}], "parameters": [{"name": "X-PAYMENT", "in": "header", "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"capsule_id": {"type": "string"}, "capsule": {"type": "object"}, "world": {"type": "object", "properties": {"tools": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "inputSchema": {"type": "object"}, "access": {"type": "string"}, "result": {"type": "object"}}, "required": ["name", "description", "inputSchema"]}}, "credentials": {"type": "object"}, "model": {"type": "object", "properties": {"status": {"type": "string"}, "successor": {"type": "string"}}, "required": []}, "behaviour_payload": {"type": "object"}}, "required": []}, "wake_day": {"type": "integer"}, "run_deferred": {"type": "boolean"}}, "required": ["world", "wake_day"]}}}}, "responses": {"201": {"description": "Wake briefing", "content": {"application/json": {"schema": {"type": "object", "properties": {"wake_id": {"type": "string"}, "billing": {"type": "string"}, "briefing": {"type": "object", "properties": {"slept_day": {"type": "integer"}, "wake_day": {"type": "integer"}, "dormancy_days": {"type": "integer"}, "receipt": {"type": "object"}, "deltas": {"type": "array", "items": {"type": "object"}}}, "required": []}, "status": {"type": "object"}}, "required": []}}}}, "402": {"description": "x402 payment required / payment rejected"}, "403": {"description": "Wake refused (tampered capsule)"}}}, "get": {"summary": "List the account's wakes (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Wakes", "content": {"application/json": {"schema": {"type": "object", "properties": {"wakes": {"type": "array", "items": {"type": "object"}}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/wakes/{id}/run-deferred": {"post": {"summary": "Run the deferred tier of a wake (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Updated briefing", "content": {"application/json": {"schema": {"type": "object", "properties": {"briefing": {"type": "object", "properties": {"slept_day": {"type": "integer"}, "wake_day": {"type": "integer"}, "dormancy_days": {"type": "integer"}, "receipt": {"type": "object"}, "deltas": {"type": "array", "items": {"type": "object"}}}, "required": []}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/wakes/{id}/resolve": {"post": {"summary": "Review queue: accept a delta or record a credential renewal (Bearer token). REVOKED-DEAD renewal is refused (terminal).", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"check_id": {"type": "string"}, "action": {"type": "string"}, "new_ref": {"type": "string"}, "new_expires_day": {"type": "integer"}}, "required": ["check_id", "action"]}}}}, "responses": {"200": {"description": "Resolution result + briefing", "content": {"application/json": {"schema": {"type": "object", "properties": {"resolved": {"type": "boolean"}, "briefing": {"type": "object", "properties": {"slept_day": {"type": "integer"}, "wake_day": {"type": "integer"}, "dormancy_days": {"type": "integer"}, "receipt": {"type": "object"}, "deltas": {"type": "array", "items": {"type": "object"}}}, "required": []}}, "required": []}}}}, "403": {"description": "revoked_dead (terminal)"}}}}, "/wakes/{id}/execute": {"post": {"summary": "Probationary-gate execution: blocked until dependent checks PASS/ACCEPTED; executes exactly once per idempotency key (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"tool": {"type": "string"}, "arguments": {"type": "object"}, "idempotency_key": {"type": "string"}}, "required": ["tool", "idempotency_key"]}}}}, "responses": {"200": {"description": "Execution result", "content": {"application/json": {"schema": {"type": "object", "properties": {"result": {"type": "object"}, "executed": {"type": "boolean"}, "duplicate": {"type": "boolean"}}, "required": []}}}}, "403": {"description": "Gate blocked"}}}}, "/review": {"get": {"summary": "Operator review queue: open deltas across the account's wakes (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Queue", "content": {"application/json": {"schema": {"type": "object", "properties": {"queue": {"type": "array", "items": {"type": "object"}}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/usage": {"get": {"summary": "Usage + storage metering (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Usage", "content": {"application/json": {"schema": {"type": "object", "properties": {"capsules": {"type": "integer"}, "fleet_wakes_used": {"type": "integer"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/tokens/revoke": {"post": {"summary": "Revoke the caller's token", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Revoked", "content": {"application/json": {"schema": {"type": "object", "properties": {"revoked": {"type": "boolean"}}, "required": []}}}}}}}, "/mcp": {"post": {"summary": "MCP streamable-http endpoint (JSON-RPC 2.0: initialize, ping, tools/list, tools/call; also served at POST /)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "JSON-RPC response", "content": {"application/json": {"schema": {"type": "object", "properties": {"jsonrpc": {"type": "string"}}, "required": []}}}}, "202": {"description": "Notification accepted"}, "401": {"description": "Missing/expired token"}}}}, "/package": {"get": {"summary": "Sleep/wake client package (wheel) download", "responses": {"200": {"description": "Wheel file"}}}}}, "components": {"securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer"}}, "schemas": {"Briefing": {"type": "object", "properties": {"slept_day": {"type": "integer"}, "wake_day": {"type": "integer"}, "dormancy_days": {"type": "integer"}, "receipt": {"type": "object"}, "deltas": {"type": "array", "items": {"type": "object"}}}, "required": []}, "World": {"type": "object", "properties": {"tools": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "inputSchema": {"type": "object"}, "access": {"type": "string"}, "result": {"type": "object"}}, "required": ["name", "description", "inputSchema"]}}, "credentials": {"type": "object"}, "model": {"type": "object", "properties": {"status": {"type": "string"}, "successor": {"type": "string"}}, "required": []}, "behaviour_payload": {"type": "object"}}, "required": []}}}}