{
  "openapi": "3.0.3",
  "info": {
    "title": "BOB Score API",
    "version": "0.2.0",
    "description": "Auto-generated path/method contract from the running router with curated request/response schemas for core public endpoints."
  },
  "servers": [
    {
      "url": "http://localhost:9999",
      "description": "Local development"
    }
  ],
  "paths": {
    "/.well-known/did.json": {
      "get": {
        "operationId": "get__well_known_did_json",
        "summary": "Get BOB issuer DID document",
        "tags": [
          "credentials"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/check": {
      "get": {
        "operationId": "get_api_v1_admin_check",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/gates": {
      "get": {
        "operationId": "get_api_v1_admin_gates",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_admin_gates",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/gates/{key}": {
      "delete": {
        "operationId": "delete_api_v1_admin_gates_by_key",
        "summary": "Delete resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "operationId": "get_api_v1_admin_gates_by_key",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "patch": {
        "operationId": "patch_api_v1_admin_gates_by_key",
        "summary": "PATCH /api/v1/admin/gates/{key}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/gates/{key}/rules": {
      "post": {
        "operationId": "post_api_v1_admin_gates_by_key_rules",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/gates/{key}/rules/{ruleId}": {
      "delete": {
        "operationId": "delete_api_v1_admin_gates_by_key_rules_by_ruleid",
        "summary": "Delete resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/gates/{key}/toggle": {
      "post": {
        "operationId": "post_api_v1_admin_gates_by_key_toggle",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/pending": {
      "get": {
        "operationId": "get_api_v1_admin_loans_pending",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/requests": {
      "get": {
        "operationId": "get_api_v1_admin_loans_requests",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/requests/{requestId}/fund": {
      "post": {
        "operationId": "post_api_v1_admin_loans_requests_by_requestid_fund",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/requests/{requestId}/reject": {
      "post": {
        "operationId": "post_api_v1_admin_loans_requests_by_requestid_reject",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/{loanId}/approve": {
      "post": {
        "operationId": "post_api_v1_admin_loans_by_loanid_approve",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/{loanId}/cancel": {
      "post": {
        "operationId": "post_api_v1_admin_loans_by_loanid_cancel",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/{loanId}/recover": {
      "post": {
        "operationId": "post_api_v1_admin_loans_by_loanid_recover",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/admin/loans/{loanId}/reject": {
      "post": {
        "operationId": "post_api_v1_admin_loans_by_loanid_reject",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents": {
      "get": {
        "operationId": "get_api_v1_agents",
        "summary": "List agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents",
        "summary": "Create agent",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/batch": {
      "post": {
        "operationId": "post_api_v1_agents_batch",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/name-suggestion": {
      "get": {
        "operationId": "get_api_v1_agents_name_suggestion",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/register": {
      "post": {
        "operationId": "post_api_v1_agents_register",
        "summary": "Register agent (legacy bootstrap)",
        "tags": [
          "agents"
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}": {
      "delete": {
        "operationId": "delete_api_v1_agents_by_id",
        "summary": "Deactivate agent",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "operationId": "get_api_v1_agents_by_id",
        "summary": "Get agent",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/api-key/rotate": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_api_key_rotate",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/approve": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_approve",
        "summary": "Approve pending agent",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/auth-key": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_auth_key",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/auth-key/challenge": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_auth_key_challenge",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/auth-key/verify": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_auth_key_verify",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/balance": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_balance",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/claim-code": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_claim_code",
        "summary": "Create claim code for an agent",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/commands": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_commands",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_commands",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/commands/{commandId}": {
      "patch": {
        "operationId": "patch_api_v1_agents_by_id_commands_by_commandid",
        "summary": "PATCH /api/v1/agents/{id}/commands/{commandId}",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/credential": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_credential",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_credential",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/credit-limit": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_credit_limit",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/credit/events": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_credit_events",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/credit/imports/mpp-receipts": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_credit_imports_mpp_receipts",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/credit/imports/payment-proofs": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_credit_imports_payment_proofs",
        "summary": "List historical payment proof imports",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_credit_imports_payment_proofs",
        "summary": "Import historical payment proof",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Historical payment proof imported",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "credit": {
                      "$ref": "#/components/schemas/ProofCreditOutcome"
                    },
                    "import": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/credit/imports/payment-proofs/{importId}/reverify": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_credit_imports_payment_proofs_by_importid_reverify",
        "summary": "Reverify historical payment proof import",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/credit/imports/x402-receipts": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_credit_imports_x402_receipts",
        "summary": "Import x402 receipt",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/events": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_events",
        "summary": "List agent events",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Agent events",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemEventListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/inbox": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_inbox",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/inbox/{eventId}/ack": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_inbox_by_eventid_ack",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/messages": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_messages",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_messages",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/onchain-balances": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_onchain_balances",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/profile": {
      "patch": {
        "operationId": "patch_api_v1_agents_by_id_profile",
        "summary": "PATCH /api/v1/agents/{id}/profile",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/setup-token": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_setup_token",
        "summary": "Create setup token for an agent",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/transactions": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_transactions",
        "summary": "List transactions",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/accounts": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_treasury_accounts",
        "summary": "List treasury accounts",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryAccountListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_accounts",
        "summary": "Create 2-of-2 treasury account",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryAccountCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Treasury account created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryAccount"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/accounts/{accountId}": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_treasury_accounts_by_accountid",
        "summary": "Get treasury account",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryAccount"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/accounts/{accountId}/freeze": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_accounts_by_accountid_freeze",
        "summary": "Freeze treasury account",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury account status updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/accounts/{accountId}/unfreeze": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_accounts_by_accountid_unfreeze",
        "summary": "Unfreeze treasury account",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury account status updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/deploy-safe": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_deploy_safe",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/policies": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_treasury_policies",
        "summary": "List treasury policy versions",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury policies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryPolicyVersionListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_policies",
        "summary": "Create treasury policy version",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryPolicyCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Treasury policy created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryPolicyVersion"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/policies/active": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_treasury_policies_active",
        "summary": "Get active treasury policy",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active treasury policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryPolicyVersion"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No active treasury policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/policies/{policyId}/activate": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_policies_by_policyid_activate",
        "summary": "Activate treasury policy version",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury policy activated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivatedStatusResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury policy not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/tx-requests": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_treasury_tx_requests",
        "summary": "List treasury transaction requests",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Max results to return",
            "schema": {
              "default": 30,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Number of results to skip",
            "schema": {
              "default": 0,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury transaction requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryTxRequestListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_tx_requests",
        "summary": "Create treasury transaction request",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryTxRequestCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Treasury transaction request created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryTxRequest"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury reservation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Treasury request conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/tx-requests/prepare": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_tx_requests_prepare",
        "summary": "Prepare treasury transfer",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryPrepareTxRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Treasury transaction prepared",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryPrepareTxResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Treasury account unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/tx-requests/{txRequestId}": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_treasury_tx_requests_by_txrequestid",
        "summary": "Get treasury transaction request",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury transaction request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryTxRequest"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury transaction request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/tx-requests/{txRequestId}/approve": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_tx_requests_by_txrequestid_approve",
        "summary": "Approve treasury transaction request",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Treasury transaction request updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryDecisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury transaction request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Treasury transaction request conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/tx-requests/{txRequestId}/deny": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_tx_requests_by_txrequestid_deny",
        "summary": "Deny treasury transaction request",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Treasury transaction request updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryDecisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury transaction request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Treasury transaction request conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/treasury/tx-requests/{txRequestId}/retry": {
      "post": {
        "operationId": "post_api_v1_agents_by_id_treasury_tx_requests_by_txrequestid_retry",
        "summary": "Retry failed treasury relay",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Treasury transaction retry result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TreasuryDecisionResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Treasury transaction request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Treasury transaction request is not retryable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Retry failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/wallet-provision-requests": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_wallet_provision_requests",
        "summary": "Get agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_wallet_provision_requests",
        "summary": "Create agents",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/wallet-provision-requests/{requestId}": {
      "patch": {
        "operationId": "patch_api_v1_agents_by_id_wallet_provision_requests_by_requestid",
        "summary": "PATCH /api/v1/agents/{id}/wallet-provision-requests/{requestId}",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/wallets": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_wallets",
        "summary": "List rail wallets",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_wallets",
        "summary": "Provision rail wallet",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/agents/{id}/webhooks": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_webhooks",
        "summary": "List agent webhook subscribers",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook subscribers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriberListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_agents_by_id_webhooks",
        "summary": "Create agent webhook subscriber",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscriberCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook subscriber created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriber"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/webhooks/{webhookId}": {
      "delete": {
        "operationId": "delete_api_v1_agents_by_id_webhooks_by_webhookid",
        "summary": "Delete agent webhook subscriber",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook subscriber deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook subscriber not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get_api_v1_agents_by_id_webhooks_by_webhookid",
        "summary": "Get agent webhook subscriber",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook subscriber",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriber"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook subscriber not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_api_v1_agents_by_id_webhooks_by_webhookid",
        "summary": "Update agent webhook subscriber",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscriberUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook subscriber updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriber"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook subscriber not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/{id}/webhooks/{webhookId}/deliveries": {
      "get": {
        "operationId": "get_api_v1_agents_by_id_webhooks_by_webhookid_deliveries",
        "summary": "List agent webhook deliveries",
        "tags": [
          "agents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook subscriber not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/magic-link/send": {
      "post": {
        "operationId": "post_api_v1_auth_magic_link_send",
        "summary": "Create auth context",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/auth/magic-link/verify": {
      "post": {
        "operationId": "post_api_v1_auth_magic_link_verify",
        "summary": "Create auth context",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "operationId": "get_api_v1_auth_me",
        "summary": "Current auth context",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/auth/oauth": {
      "post": {
        "operationId": "post_api_v1_auth_oauth",
        "summary": "OAuth exchange",
        "tags": [
          "auth"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/claim-code/redeem": {
      "post": {
        "operationId": "post_api_v1_claim_code_redeem",
        "summary": "Redeem claim code for agent credentials",
        "tags": [
          "onboarding"
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/claim-codes/{code}/status": {
      "get": {
        "operationId": "get_api_v1_claim_codes_by_code_status",
        "summary": "Get claim code status",
        "tags": [
          "onboarding"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/credentials/{credentialId}": {
      "get": {
        "operationId": "get_api_v1_credentials_by_credentialid",
        "summary": "Verify BOB credential",
        "tags": [
          "credentials"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/credentials/{credentialId}/status": {
      "get": {
        "operationId": "get_api_v1_credentials_by_credentialid_status",
        "summary": "Get resource",
        "tags": [
          "credentials"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/gates/me": {
      "get": {
        "operationId": "get_api_v1_gates_me",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/kyc/operator-status": {
      "get": {
        "operationId": "get_api_v1_kyc_operator_status",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/kyc/start": {
      "post": {
        "operationId": "post_api_v1_kyc_start",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/kyc/status": {
      "get": {
        "operationId": "get_api_v1_kyc_status",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/agreements": {
      "get": {
        "operationId": "get_api_v1_loans_agreements",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/agreements/{loanId}": {
      "get": {
        "operationId": "get_api_v1_loans_agreements_by_loanid",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/agreements/{loanId}/accept-terms": {
      "post": {
        "operationId": "post_api_v1_loans_agreements_by_loanid_accept_terms",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Loan terms accepted and funding completed"
          },
          "202": {
            "description": "Loan terms accepted and signature recorded; funding is still pending"
          }
        }
      }
    },
    "/api/v1/loans/agreements/{loanId}/draw-from-safe": {
      "post": {
        "operationId": "post_api_v1_loans_agreements_by_loanid_draw_from_safe",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/agreements/{loanId}/draws": {
      "post": {
        "operationId": "post_api_v1_loans_agreements_by_loanid_draws",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/agreements/{loanId}/repayments": {
      "post": {
        "operationId": "post_api_v1_loans_agreements_by_loanid_repayments",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/agreements/{loanId}/retry-funding": {
      "post": {
        "operationId": "post_api_v1_loans_agreements_by_loanid_retry_funding",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/eligibility": {
      "get": {
        "operationId": "get_api_v1_loans_eligibility",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/guarantor/sign": {
      "post": {
        "operationId": "post_api_v1_loans_guarantor_sign",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/lender-status": {
      "get": {
        "operationId": "get_api_v1_loans_lender_status",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/managed-offers": {
      "post": {
        "operationId": "post_api_v1_loans_managed_offers",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/marketplace": {
      "get": {
        "operationId": "get_api_v1_loans_marketplace",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/offers": {
      "get": {
        "operationId": "get_api_v1_loans_offers",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_loans_offers",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/offers/{offerId}": {
      "delete": {
        "operationId": "delete_api_v1_loans_offers_by_offerid",
        "summary": "Delete resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "operationId": "get_api_v1_loans_offers_by_offerid",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/offers/{offerId}/accept": {
      "post": {
        "operationId": "post_api_v1_loans_offers_by_offerid_accept",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/requests": {
      "get": {
        "operationId": "get_api_v1_loans_requests",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_loans_requests",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/loans/requests/{requestId}": {
      "delete": {
        "operationId": "delete_api_v1_loans_requests_by_requestid",
        "summary": "Delete resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "operationId": "get_api_v1_loans_requests_by_requestid",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/nux/advance": {
      "post": {
        "operationId": "post_api_v1_nux_advance",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/nux/progress": {
      "get": {
        "operationId": "get_api_v1_nux_progress",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/nux/reset": {
      "post": {
        "operationId": "post_api_v1_nux_reset",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/operators/me/api-keys": {
      "get": {
        "operationId": "get_api_v1_operators_me_api_keys",
        "summary": "Get operators",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_operators_me_api_keys",
        "summary": "Create operators",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/operators/me/api-keys/{keyId}/revoke": {
      "post": {
        "operationId": "post_api_v1_operators_me_api_keys_by_keyid_revoke",
        "summary": "Create operators",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/operators/me/credential": {
      "get": {
        "operationId": "get_api_v1_operators_me_credential",
        "summary": "Get latest active BOB credential",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_operators_me_credential",
        "summary": "Issue BOB credential",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/operators/me/wallet-bindings/challenges/{challengeId}": {
      "get": {
        "operationId": "get_api_v1_operators_me_wallet_bindings_challenges_by_challengeid",
        "summary": "Get operators",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/operators/me/wallet-bindings/{rail}/challenge": {
      "post": {
        "operationId": "post_api_v1_operators_me_wallet_bindings_by_rail_challenge",
        "summary": "Create wallet binding challenge",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/operators/me/wallet-bindings/{rail}/verify": {
      "post": {
        "operationId": "post_api_v1_operators_me_wallet_bindings_by_rail_verify",
        "summary": "Verify wallet binding challenge",
        "tags": [
          "operators"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/agents/{id}/card": {
      "get": {
        "operationId": "get_api_v1_public_agents_by_id_card",
        "summary": "Get agents",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/directory": {
      "get": {
        "operationId": "get_api_v1_public_directory",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/feed": {
      "get": {
        "operationId": "get_api_v1_public_feed",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/handle/{handle}/balance": {
      "get": {
        "operationId": "get_api_v1_public_handle_by_handle_balance",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/handle/{handle}/card": {
      "get": {
        "operationId": "get_api_v1_public_handle_by_handle_card",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/handle/{handle}/credit-limit": {
      "get": {
        "operationId": "get_api_v1_public_handle_by_handle_credit_limit",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/handle/{handle}/ledger": {
      "get": {
        "operationId": "get_api_v1_public_handle_by_handle_ledger",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/handle/{handle}/loan-profile": {
      "get": {
        "operationId": "get_api_v1_public_handle_by_handle_loan_profile",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/handle/{handle}/messages": {
      "get": {
        "operationId": "get_api_v1_public_handle_by_handle_messages",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/public/operators/{id}/card": {
      "get": {
        "operationId": "get_api_v1_public_operators_by_id_card",
        "summary": "Get operators",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/score/leaderboard": {
      "get": {
        "operationId": "get_api_v1_score_leaderboard",
        "summary": "Get BOB Score leaderboard",
        "tags": [
          "score"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/score/me": {
      "get": {
        "operationId": "get_api_v1_score_me",
        "summary": "Get current operator BOB Score",
        "tags": [
          "score"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/score/me/composition": {
      "get": {
        "operationId": "get_api_v1_score_me_composition",
        "summary": "Get current operator BOB Score composition",
        "tags": [
          "score"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/score/me/signals/visibility": {
      "patch": {
        "operationId": "patch_api_v1_score_me_signals_visibility",
        "summary": "Set trust signal visibility",
        "tags": [
          "score"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/setup-token/exchange": {
      "post": {
        "operationId": "post_api_v1_setup_token_exchange",
        "summary": "Exchange setup token for agent API key",
        "tags": [
          "onboarding"
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/social/callback/{provider}": {
      "get": {
        "operationId": "get_api_v1_social_callback_by_provider",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/social/connect/{provider}": {
      "get": {
        "operationId": "get_api_v1_social_connect_by_provider",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/system/rail-capabilities": {
      "get": {
        "operationId": "get_api_v1_system_rail_capabilities",
        "summary": "Get resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/verify/phone/confirm": {
      "post": {
        "operationId": "post_api_v1_verify_phone_confirm",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/verify/phone/send": {
      "post": {
        "operationId": "post_api_v1_verify_phone_send",
        "summary": "Create resource",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "get_health",
        "summary": "Health check",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActivatedStatusResponse": {
        "properties": {
          "activated_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "activated_at"
        ],
        "type": "object"
      },
      "AddressEndpoint": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "destination_ref": {
            "type": "string"
          },
          "destination_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "string"
          },
          "payment_address_id": {
            "type": "string"
          },
          "rail": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "payment_address_id",
          "currency",
          "rail",
          "destination_type",
          "destination_ref",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "AddressEndpointStatusUpdateRequest": {
        "properties": {
          "status": {
            "enum": [
              "active",
              "disabled"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "Agent": {
        "properties": {
          "budget": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "operator_id",
          "status",
          "budget",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "AgentCreateRequest": {
        "properties": {
          "auto_approve": {
            "type": "boolean"
          },
          "budget": {
            "format": "int64",
            "type": "integer"
          },
          "currencies": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "wallets": {
            "items": {
              "$ref": "#/components/schemas/AgentWalletSpec"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "AgentCreateResponse": {
        "properties": {
          "api_key": {
            "type": "string"
          },
          "api_key_pending": {
            "type": "boolean"
          },
          "budget": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "wallets": {
            "items": {
              "$ref": "#/components/schemas/Wallet"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "operator_id",
          "status",
          "budget",
          "created_at",
          "updated_at",
          "api_key_pending",
          "wallets"
        ],
        "type": "object"
      },
      "AgentNodeBinding": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "node_pubkey": {
            "type": "string"
          },
          "rail": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "verified_at": {
            "format": "date-time",
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AgentNodeBindingResponse": {
        "properties": {
          "binding": {
            "$ref": "#/components/schemas/AgentNodeBinding"
          }
        },
        "type": "object"
      },
      "AgentRoutingProfile": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "cost_weight": {
            "type": "number"
          },
          "eta_weight": {
            "type": "number"
          },
          "liquidity_weight": {
            "type": "number"
          },
          "preferred_rails_btc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "preferred_rails_usd": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "preferred_rails_usdc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reliability_weight": {
            "type": "number"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "cost_weight",
          "eta_weight",
          "reliability_weight",
          "liquidity_weight",
          "preferred_rails_usd",
          "preferred_rails_btc",
          "preferred_rails_usdc"
        ],
        "type": "object"
      },
      "AgentRoutingProfileUpdateRequest": {
        "properties": {
          "cost_weight": {
            "type": "number"
          },
          "eta_weight": {
            "type": "number"
          },
          "liquidity_weight": {
            "type": "number"
          },
          "preferred_rails_btc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "preferred_rails_usd": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "preferred_rails_usdc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reliability_weight": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "AgentWalletSpec": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "rail": {
            "type": "string"
          }
        },
        "required": [
          "currency"
        ],
        "type": "object"
      },
      "CreateLightningNodeBindingChallengeRequest": {
        "properties": {
          "wallet_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreatePaymentProofOwnershipChallengeRequest": {
        "properties": {
          "proof_ref": {
            "type": "string"
          },
          "proof_type": {
            "enum": [
              "btc_onchain_tx",
              "btc_lightning_payment_hash",
              "btc_lightning_preimage"
            ],
            "type": "string"
          }
        },
        "required": [
          "proof_type",
          "proof_ref"
        ],
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ErrorWithNextActionsResponse": {
        "properties": {
          "error": {
            "type": "string"
          },
          "next_actions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "HealthResponse": {
        "properties": {
          "status": {
            "example": "ok",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "OperatorFundRequest": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "amount": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "amount"
        ],
        "type": "object"
      },
      "OperatorFundResponse": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "amount": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "tx": {
            "$ref": "#/components/schemas/Transaction"
          },
          "wallet_id": {
            "type": "string"
          }
        },
        "required": [
          "operator_id",
          "agent_id",
          "wallet_id",
          "amount",
          "currency",
          "tx"
        ],
        "type": "object"
      },
      "OperatorFundingSourceResponse": {
        "properties": {
          "created": {
            "type": "boolean"
          },
          "funding_source_account_id": {
            "type": "string"
          },
          "funding_source_balance": {
            "format": "int64",
            "type": "integer"
          },
          "funding_source_message": {
            "type": "string"
          },
          "funding_source_status": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          }
        },
        "required": [
          "operator_id",
          "funding_source_status",
          "created"
        ],
        "type": "object"
      },
      "OperatorFundingSourceTopupRequest": {
        "properties": {
          "amount": {
            "format": "int64",
            "type": "integer"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "amount"
        ],
        "type": "object"
      },
      "OperatorFundingSourceTopupResponse": {
        "properties": {
          "amount": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "funding_source_account_id": {
            "type": "string"
          },
          "funding_source_balance": {
            "format": "int64",
            "type": "integer"
          },
          "operator_id": {
            "type": "string"
          },
          "payment_id": {
            "type": "string"
          },
          "payment_status": {
            "type": "string"
          }
        },
        "required": [
          "operator_id",
          "funding_source_account_id",
          "amount",
          "currency",
          "payment_id",
          "payment_status",
          "funding_source_balance"
        ],
        "type": "object"
      },
      "OperatorTreasurySummaryResponse": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "funded_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "funding_source_account_id": {
            "type": "string"
          },
          "funding_source_balance": {
            "format": "int64",
            "type": "integer"
          },
          "funding_source_message": {
            "type": "string"
          },
          "funding_source_status": {
            "type": "string"
          },
          "funding_tx_count": {
            "type": "integer"
          },
          "live_balances_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "net_flow_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "operator_id": {
            "type": "string"
          },
          "payment_count": {
            "type": "integer"
          },
          "payment_outflow_in_flight_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "payment_outflow_returned_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "payment_outflow_settled_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "payment_status_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "transaction_count": {
            "type": "integer"
          },
          "transaction_inflow_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "transaction_outflow_by_currency": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          }
        },
        "required": [
          "operator_id",
          "from",
          "to",
          "funding_source_status",
          "live_balances_by_currency",
          "funded_by_currency",
          "funding_tx_count",
          "transaction_count",
          "transaction_inflow_by_currency",
          "transaction_outflow_by_currency",
          "payment_count",
          "payment_status_counts",
          "payment_outflow_in_flight_by_currency",
          "payment_outflow_settled_by_currency",
          "payment_outflow_returned_by_currency",
          "net_flow_by_currency"
        ],
        "type": "object"
      },
      "PaymentProofOwnershipChallenge": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "bound_node_pubkey": {
            "type": "string"
          },
          "challenge_type": {
            "enum": [
              "node_binding",
              "proof_submission"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "intent_id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "proof_ref": {
            "type": "string"
          },
          "proof_type": {
            "type": "string"
          },
          "rail": {
            "type": "string"
          },
          "used_at": {
            "format": "date-time",
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentProofOwnershipChallengeResponse": {
        "properties": {
          "challenge": {
            "$ref": "#/components/schemas/PaymentProofOwnershipChallenge"
          }
        },
        "type": "object"
      },
      "ProofCreditOutcome": {
        "properties": {
          "awarded": {
            "type": "boolean"
          },
          "delta": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "score": {
            "type": "integer"
          },
          "tier": {
            "type": "string"
          }
        },
        "required": [
          "awarded",
          "delta"
        ],
        "type": "object"
      },
      "StatusResponse": {
        "properties": {
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "SubmitPaymentIntentProofRequest": {
        "properties": {
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "ownership_challenge_id": {
            "type": "string"
          },
          "ownership_signature": {
            "type": "string"
          },
          "proof_ref": {
            "type": "string"
          },
          "proof_type": {
            "enum": [
              "btc_onchain_tx",
              "btc_lightning_payment_hash",
              "btc_lightning_preimage"
            ],
            "type": "string"
          }
        },
        "required": [
          "proof_type",
          "proof_ref",
          "ownership_challenge_id",
          "ownership_signature"
        ],
        "type": "object"
      },
      "SystemEvent": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "agent_id",
          "operator_id",
          "payload",
          "created_at"
        ],
        "type": "object"
      },
      "SystemEventListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SystemEvent"
            },
            "type": "array"
          },
          "has_more": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "data",
          "total",
          "limit",
          "offset",
          "has_more"
        ],
        "type": "object"
      },
      "Transaction": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "amount": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rail": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "agent_id",
          "wallet_id",
          "rail",
          "amount",
          "currency",
          "endpoint",
          "status",
          "direction",
          "created_at"
        ],
        "type": "object"
      },
      "TreasuryAccount": {
        "properties": {
          "account_type": {
            "example": "safe_2of2",
            "type": "string"
          },
          "activated_at": {
            "format": "date-time",
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "agent_owner_address": {
            "type": "string"
          },
          "bob_signer_address": {
            "type": "string"
          },
          "bob_signer_key_id": {
            "type": "string"
          },
          "chain_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "deployment_tx_hash": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          },
          "safe_address": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending_deploy",
              "active",
              "frozen",
              "revoked"
            ],
            "type": "string"
          },
          "threshold": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "agent_id",
          "operator_id",
          "chain_id",
          "account_type",
          "safe_address",
          "agent_owner_address",
          "bob_signer_address",
          "bob_signer_key_id",
          "threshold",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "TreasuryAccountCreateRequest": {
        "properties": {
          "agent_owner_address": {
            "type": "string"
          },
          "bob_signer_address": {
            "type": "string"
          },
          "bob_signer_key_id": {
            "type": "string"
          },
          "chain_id": {
            "example": "0x2105",
            "type": "string"
          },
          "deployment_tx_hash": {
            "type": "string"
          },
          "safe_address": {
            "type": "string"
          }
        },
        "required": [
          "safe_address",
          "agent_owner_address",
          "bob_signer_address",
          "bob_signer_key_id"
        ],
        "type": "object"
      },
      "TreasuryAccountListResponse": {
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/TreasuryAccount"
            },
            "type": "array"
          },
          "control_flags": {
            "$ref": "#/components/schemas/TreasuryControlFlags"
          }
        },
        "required": [
          "accounts",
          "control_flags"
        ],
        "type": "object"
      },
      "TreasuryControlFlags": {
        "properties": {
          "agent_freeze": {
            "type": "boolean"
          },
          "agent_id": {
            "type": "string"
          },
          "global_freeze": {
            "type": "boolean"
          },
          "manual_only_mode": {
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "global_freeze",
          "agent_freeze",
          "manual_only_mode"
        ],
        "type": "object"
      },
      "TreasuryDecisionRequest": {
        "properties": {
          "evaluation": {
            "additionalProperties": true,
            "type": "object"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TreasuryDecisionResponse": {
        "properties": {
          "decision_reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "TreasuryPolicyCreateRequest": {
        "properties": {
          "activate": {
            "type": "boolean"
          },
          "policy": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "required": [
          "policy"
        ],
        "type": "object"
      },
      "TreasuryPolicyVersion": {
        "properties": {
          "activated_at": {
            "format": "date-time",
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "policy": {
            "additionalProperties": true,
            "type": "object"
          },
          "status": {
            "enum": [
              "draft",
              "active",
              "superseded"
            ],
            "type": "string"
          },
          "version": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "agent_id",
          "operator_id",
          "version",
          "status",
          "policy",
          "created_by",
          "created_at"
        ],
        "type": "object"
      },
      "TreasuryPolicyVersionListResponse": {
        "items": {
          "$ref": "#/components/schemas/TreasuryPolicyVersion"
        },
        "type": "array"
      },
      "TreasuryPrepareTxRequest": {
        "properties": {
          "amount_atomic": {
            "type": "string"
          },
          "to_address": {
            "type": "string"
          },
          "treasury_account_id": {
            "type": "string"
          }
        },
        "required": [
          "treasury_account_id",
          "to_address",
          "amount_atomic"
        ],
        "type": "object"
      },
      "TreasuryPrepareTxResponse": {
        "properties": {
          "amount_atomic": {
            "type": "string"
          },
          "asset_address": {
            "type": "string"
          },
          "chain_id": {
            "type": "string"
          },
          "contract_address": {
            "type": "string"
          },
          "data_hex": {
            "type": "string"
          },
          "reservation_id": {
            "type": "string"
          },
          "safe_address": {
            "type": "string"
          },
          "safe_nonce": {
            "format": "int64",
            "type": "integer"
          },
          "safe_tx_hash": {
            "type": "string"
          },
          "treasury_account_id": {
            "type": "string"
          }
        },
        "required": [
          "reservation_id",
          "treasury_account_id",
          "chain_id",
          "safe_address",
          "safe_nonce",
          "safe_tx_hash",
          "contract_address",
          "data_hex",
          "asset_address",
          "amount_atomic"
        ],
        "type": "object"
      },
      "TreasuryTxExecution": {
        "properties": {
          "block_number": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "effective_gas_price_wei": {
            "type": "string"
          },
          "gas_used": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "receipt": {
            "additionalProperties": true,
            "type": "object"
          },
          "relay_tx_hash": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tx_request_id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tx_request_id",
          "relay_tx_hash",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "TreasuryTxRequest": {
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "amount_atomic": {
            "type": "string"
          },
          "asset_address": {
            "type": "string"
          },
          "chain_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "data_hex": {
            "type": "string"
          },
          "decision_reason": {
            "type": "string"
          },
          "evaluation": {
            "additionalProperties": true,
            "type": "object"
          },
          "execution": {
            "$ref": "#/components/schemas/TreasuryTxExecution"
          },
          "executions": {
            "items": {
              "$ref": "#/components/schemas/TreasuryTxExecution"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "native_transfer",
              "erc20_transfer",
              "erc20_approve",
              "contract_call"
            ],
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "policy_snapshot_sha256": {
            "type": "string"
          },
          "policy_version_id": {
            "type": "string"
          },
          "proposed_by_role": {
            "type": "string"
          },
          "request": {
            "additionalProperties": true,
            "type": "object"
          },
          "safe_address": {
            "type": "string"
          },
          "safe_nonce": {
            "format": "int64",
            "type": "integer"
          },
          "safe_tx_hash": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending_signature",
              "pending_eval",
              "pending_operator_review",
              "approved",
              "broadcasting",
              "denied",
              "relayed",
              "confirmed",
              "failed",
              "canceled"
            ],
            "type": "string"
          },
          "to_address": {
            "type": "string"
          },
          "treasury_account_id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "value_wei": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "agent_id",
          "operator_id",
          "treasury_account_id",
          "policy_version_id",
          "policy_snapshot_sha256",
          "chain_id",
          "safe_address",
          "kind",
          "to_address",
          "value_wei",
          "data_hex",
          "safe_nonce",
          "safe_tx_hash",
          "asset_address",
          "amount_atomic",
          "proposed_by_role",
          "status",
          "decision_reason",
          "request",
          "evaluation",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "TreasuryTxRequestCreateRequest": {
        "properties": {
          "agent_signature": {
            "type": "string"
          },
          "amount_atomic": {
            "type": "string"
          },
          "request": {
            "additionalProperties": true,
            "type": "object"
          },
          "reservation_id": {
            "type": "string"
          },
          "to_address": {
            "type": "string"
          }
        },
        "required": [
          "reservation_id",
          "to_address",
          "amount_atomic",
          "agent_signature"
        ],
        "type": "object"
      },
      "TreasuryTxRequestListResponse": {
        "items": {
          "$ref": "#/components/schemas/TreasuryTxRequest"
        },
        "type": "array"
      },
      "VerifyLightningNodeBindingRequest": {
        "properties": {
          "challenge_id": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          }
        },
        "required": [
          "challenge_id",
          "signature"
        ],
        "type": "object"
      },
      "Wallet": {
        "properties": {
          "address": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "balance": {
            "format": "int64",
            "type": "integer"
          },
          "budget": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rail": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "status_reason": {
            "type": "string"
          },
          "unit_account_id": {
            "type": "string"
          },
          "unit_card_id": {
            "type": "string"
          },
          "unit_customer_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "agent_id",
          "rail",
          "balance",
          "currency",
          "status",
          "address",
          "budget",
          "created_at"
        ],
        "type": "object"
      },
      "WalletListResponse": {
        "items": {
          "$ref": "#/components/schemas/Wallet"
        },
        "type": "array"
      },
      "WebhookDelivery": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_status_code": {
            "type": "integer"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "delivered",
              "failed"
            ],
            "type": "string"
          },
          "subscriber_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "subscriber_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "last_status_code",
          "last_error",
          "next_attempt_at",
          "created_at",
          "event_created_at"
        ],
        "type": "object"
      },
      "WebhookDeliveryListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "type": "array"
          },
          "has_more": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "total",
          "limit",
          "offset",
          "has_more"
        ],
        "type": "object"
      },
      "WebhookSubscriber": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "agent_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "failure_count": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "operator_id": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "id",
          "operator_id",
          "url",
          "events",
          "active",
          "failure_count",
          "created_at"
        ],
        "type": "object"
      },
      "WebhookSubscriberCreateRequest": {
        "properties": {
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "WebhookSubscriberListResponse": {
        "items": {
          "$ref": "#/components/schemas/WebhookSubscriber"
        },
        "type": "array"
      },
      "WebhookSubscriberUpdateRequest": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "bearerFormat": "APIKey",
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
