{"openapi": "3.0.3", "info": {"title": "Tool-result context binding", "version": "0.1.0", "description": "Signed tool-result binding stamps + consume-time verdicts. 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", "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", "content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "claim_token": {"type": "string"}}, "required": []}}}}}}}, "/trial": {"post": {"summary": "Claim the one-time Solo trial", "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 token (shown once)", "content": {"application/json": {"schema": {"type": "object", "properties": {"token": {"type": "string"}, "tier": {"type": "string"}, "trial": {"type": "boolean"}, "expires_at": {"type": "number"}}, "required": []}}}}, "403": {"description": "Trial already used or bad claim"}}}}, "/subscribe": {"post": {"summary": "Subscribe/renew via x402 (Solo 9000000 / Fleet 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": "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"}}}}, "/verdict-check": {"post": {"summary": "Pay-per-call verdict check ($0.001 = 1000 atomic USDC); payment is the credential", "parameters": [{"name": "X-PAYMENT", "in": "header", "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"stamp": {"type": "object", "properties": {"v": {"type": "integer"}, "bid": {"type": "string"}, "task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args_hash": {"type": "string"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}, "result_hash": {"type": "string"}, "iat": {"type": "number"}, "exp": {"type": "number"}, "sig": {"type": "string"}}, "required": []}, "result": {"type": "object"}, "ctx": {"type": "object", "properties": {"task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args": {"type": "object"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}}, "required": ["task_id", "execution_id", "tool", "args", "auth_scope", "env_digest", "seq"]}, "consume": {"type": "boolean"}}, "required": ["stamp", "result", "ctx"]}}}}, "responses": {"200": {"description": "Verdict", "content": {"application/json": {"schema": {"type": "object", "properties": {"verdict": {"type": "string", "enum": ["VALID", "STALE", "WRONG-TASK", "DUPLICATE", "OUT-OF-ORDER", "INVALID", "REVALIDATED"]}, "detail": {"type": "string"}}, "required": []}}}}, "402": {"description": "x402 payment required / payment rejected"}}}}, "/bind": {"post": {"summary": "Bind a tool result (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"ctx": {"type": "object", "properties": {"task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args": {"type": "object"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}}, "required": ["task_id", "execution_id", "tool", "args", "auth_scope", "env_digest", "seq"]}, "result": {"type": "object"}, "ttl_s": {"type": "number"}}, "required": ["ctx", "result", "ttl_s"]}}}}, "responses": {"201": {"description": "Stamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"stamp": {"type": "object", "properties": {"v": {"type": "integer"}, "bid": {"type": "string"}, "task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args_hash": {"type": "string"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}, "result_hash": {"type": "string"}, "iat": {"type": "number"}, "exp": {"type": "number"}, "sig": {"type": "string"}}, "required": []}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/validate": {"post": {"summary": "Consume-time verdict (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"stamp": {"type": "object", "properties": {"v": {"type": "integer"}, "bid": {"type": "string"}, "task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args_hash": {"type": "string"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}, "result_hash": {"type": "string"}, "iat": {"type": "number"}, "exp": {"type": "number"}, "sig": {"type": "string"}}, "required": []}, "result": {"type": "object"}, "ctx": {"type": "object", "properties": {"task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args": {"type": "object"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}}, "required": ["task_id", "execution_id", "tool", "args", "auth_scope", "env_digest", "seq"]}, "consume": {"type": "boolean"}}, "required": ["stamp", "result", "ctx"]}}}}, "responses": {"200": {"description": "Verdict", "content": {"application/json": {"schema": {"type": "object", "properties": {"verdict": {"type": "string", "enum": ["VALID", "STALE", "WRONG-TASK", "DUPLICATE", "OUT-OF-ORDER", "INVALID", "REVALIDATED"]}, "detail": {"type": "string"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/revalidate": {"post": {"summary": "Revalidation-as-reissuance (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"stamp": {"type": "object", "properties": {"v": {"type": "integer"}, "bid": {"type": "string"}, "task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args_hash": {"type": "string"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}, "result_hash": {"type": "string"}, "iat": {"type": "number"}, "exp": {"type": "number"}, "sig": {"type": "string"}}, "required": []}, "result": {"type": "object"}, "ctx": {"type": "object", "properties": {"task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args": {"type": "object"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}}, "required": ["task_id", "execution_id", "tool", "args", "auth_scope", "env_digest", "seq"]}, "ttl_s": {"type": "number"}}, "required": ["stamp", "result", "ctx", "ttl_s"]}}}}, "responses": {"200": {"description": "REVALIDATED + fresh stamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"verdict": {"type": "string", "enum": ["VALID", "STALE", "WRONG-TASK", "DUPLICATE", "OUT-OF-ORDER", "INVALID", "REVALIDATED"]}, "detail": {"type": "string"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/audit": {"get": {"summary": "Account audit chain + signed head (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Audit", "content": {"application/json": {"schema": {"type": "object", "properties": {"entries": {"type": "array", "items": {"type": "object"}}, "chain_ok": {"type": "boolean"}, "head": {"type": "object"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/audit/stats": {"get": {"summary": "Verdict-distribution receipt: per-scope counts per verdict class (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Stats", "content": {"application/json": {"schema": {"type": "object", "properties": {"taxonomy": {"type": "array", "items": {"type": "string"}}, "by_scope": {"type": "object"}, "totals": {"type": "object"}}, "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": []}}}}}}}, "/package": {"get": {"summary": "Adapter package (wheel) download", "responses": {"200": {"description": "Wheel file"}}}}}, "components": {"securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer"}}, "schemas": {"Ctx": {"type": "object", "properties": {"task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args": {"type": "object"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}}, "required": ["task_id", "execution_id", "tool", "args", "auth_scope", "env_digest", "seq"]}, "Stamp": {"type": "object", "properties": {"v": {"type": "integer"}, "bid": {"type": "string"}, "task_id": {"type": "string"}, "execution_id": {"type": "string"}, "tool": {"type": "string"}, "args_hash": {"type": "string"}, "auth_scope": {"type": "string"}, "env_digest": {"type": "string"}, "seq": {"type": "integer"}, "result_hash": {"type": "string"}, "iat": {"type": "number"}, "exp": {"type": "number"}, "sig": {"type": "string"}}, "required": []}, "Verdict": {"type": "object", "properties": {"verdict": {"type": "string", "enum": ["VALID", "STALE", "WRONG-TASK", "DUPLICATE", "OUT-OF-ORDER", "INVALID", "REVALIDATED"]}, "detail": {"type": "string"}}, "required": []}}}}