{
  "components": {
    "schemas": {
      "enclz.ErrorResponse": {
        "additionalProperties": false,
        "properties": {
          "details": {
            "description": "Optional per-field validation diagnostics. Present only on `validation_error` responses; each entry names the failing field path and the schema-level reason.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "issue": {
                  "description": "Schema-level reason (e.g. `must NOT have fewer than 32 characters`).",
                  "type": "string"
                },
                "path": {
                  "description": "JSON Pointer to the failing field (e.g. `/to`).",
                  "type": "string"
                }
              },
              "required": [
                "path",
                "issue"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "error": {
            "description": "Stable business code.",
            "enum": [
              "whitelist_violation",
              "whitelist_expired",
              "whitelist_amount_exhausted",
              "daily_limit_exceeded",
              "per_tx_limit_exceeded",
              "hourly_cap_exceeded",
              "unauthorized",
              "invalid_amount",
              "invalid_mint",
              "invalid_token_account",
              "invalid_fee_account",
              "invalid_invitation_code",
              "idempotency_in_progress",
              "jupiter_unavailable",
              "token_not_in_registry",
              "recipient_invalid",
              "account_not_initialized",
              "insufficient_balance",
              "validation_error",
              "internal_error"
            ],
            "type": "string"
          },
          "message": {
            "description": "Human-readable remediation.",
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "type": "object"
      },
      "enclz.TxReceipt": {
        "description": "Confirmation receipt for a completed operation.",
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "API key (`enclz_<random>`)",
        "description": "Agent API key minted by `POST /api/v1/register`.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Bearer-authenticated REST API for AI agents running on Enclz. The agent runtime is described in business terms only — the same operations are also exposed as MCP tools and resources via `@enclz/mcp` and as a system-prompt fragment in `SKILL.md`.",
    "license": {
      "identifier": "MIT",
      "name": "MIT"
    },
    "title": "Enclz Agent API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/balance": {
      "get": {
        "operationId": "getBalance",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "balances": {
                      "additionalProperties": {
                        "minimum": 0,
                        "type": "number"
                      },
                      "description": "Map of token symbol to balance in human units.",
                      "type": "object"
                    },
                    "daily_limit": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "daily_remaining": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "hourly_tx_cap": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "hourly_tx_remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "per_tx_limit": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    }
                  },
                  "required": [
                    "balances",
                    "daily_limit",
                    "daily_remaining",
                    "per_tx_limit",
                    "hourly_tx_cap",
                    "hourly_tx_remaining"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Read agent balances and remaining headroom",
        "tags": [
          "state"
        ]
      }
    },
    "/api/v1/deposit": {
      "post": {
        "operationId": "deposit",
        "parameters": [
          {
            "description": "Reuse the same value on retry. Generating a new key submits a duplicate request.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "description": "Token amount in human units. Six-decimal precision.",
                    "minimum": 0,
                    "type": "number"
                  },
                  "cpi_data": {
                    "description": "Opaque instruction body forwarded to the lending venue.",
                    "items": {
                      "maximum": 255,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "idempotency_key": {
                    "description": "Required. Reuse the same key on retry. Generating a new key submits a duplicate operation.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "lending_program": {
                    "description": "Identifier of an allow-listed lending venue.",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  },
                  "mint": {
                    "description": "Opaque token identifier (base58).",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  }
                },
                "required": [
                  "amount",
                  "lending_program",
                  "idempotency_key"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "deposited_amount": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "status": {
                      "enum": [
                        "confirmed"
                      ],
                      "type": "string"
                    },
                    "tx_sig": {
                      "$ref": "#/components/schemas/enclz.TxReceipt"
                    }
                  },
                  "required": [
                    "tx_sig",
                    "status",
                    "deposited_amount"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Deposit into an allow-listed lending venue",
        "tags": [
          "intents"
        ]
      }
    },
    "/api/v1/history": {
      "get": {
        "description": "Returns the most recent confirmed intents over a 24-hour window.",
        "operationId": "getHistory",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "transactions": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "action": {
                            "enum": [
                              "transfer",
                              "swap"
                            ],
                            "type": "string"
                          },
                          "amount": {
                            "description": "Token amount in human units. Six-decimal precision.",
                            "minimum": 0,
                            "type": "number"
                          },
                          "memo": {
                            "type": "string"
                          },
                          "net_amount": {
                            "description": "Token amount in human units. Six-decimal precision.",
                            "minimum": 0,
                            "type": "number"
                          },
                          "protocol_fee": {
                            "description": "Token amount in human units. Six-decimal precision.",
                            "minimum": 0,
                            "type": "number"
                          },
                          "task_id": {
                            "type": "string"
                          },
                          "timestamp": {
                            "description": "Unix epoch seconds.",
                            "type": "integer"
                          },
                          "to": {
                            "type": "string"
                          },
                          "token": {
                            "type": "string"
                          },
                          "tx_sig": {
                            "$ref": "#/components/schemas/enclz.TxReceipt"
                          }
                        },
                        "required": [
                          "tx_sig",
                          "action",
                          "amount",
                          "timestamp"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "transactions"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Read recent confirmed-intent history",
        "tags": [
          "state"
        ]
      }
    },
    "/api/v1/intents/simulate": {
      "post": {
        "description": "Mirrors `transfer` and reports whether it would succeed under current limits.",
        "operationId": "simulate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "description": "Token amount in human units. Six-decimal precision.",
                    "minimum": 0,
                    "type": "number"
                  },
                  "mint": {
                    "description": "Opaque token identifier (base58).",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  },
                  "to": {
                    "description": "Optional recipient identifier.",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  }
                },
                "required": [
                  "amount"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "daily_remaining": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "estimated_fee": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "hourly_tx_remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reason": {
                      "description": "Curated business code explaining why `would_succeed` is `false`. Mirrors `error` on `enclz.ErrorResponse`. Absent when `would_succeed` is `true`.",
                      "type": "string"
                    },
                    "would_succeed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "would_succeed",
                    "daily_remaining",
                    "hourly_tx_remaining",
                    "estimated_fee"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Dry-run a transfer without committing it",
        "tags": [
          "intents"
        ]
      }
    },
    "/api/v1/limits": {
      "get": {
        "operationId": "getLimits",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "daily_limit": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "daily_remaining": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "group_id": {
                      "description": "Opaque agent group identifier.",
                      "type": "string"
                    },
                    "hourly_tx_cap": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "hourly_tx_remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "per_tx_limit": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    }
                  },
                  "required": [
                    "daily_limit",
                    "daily_remaining",
                    "per_tx_limit",
                    "hourly_tx_cap",
                    "hourly_tx_remaining",
                    "group_id"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Read agent spend limits and counters",
        "tags": [
          "state"
        ]
      }
    },
    "/api/v1/register": {
      "post": {
        "description": "Exchanges a one-time invitation code (provisioned by the operator) for the agent API key. The plaintext key is returned exactly once.",
        "operationId": "register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "invitation_code": {
                    "type": "string"
                  }
                },
                "required": [
                  "invitation_code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "agent_wallet_pda": {
                      "description": "Opaque agent identifier.",
                      "type": "string"
                    },
                    "api_key": {
                      "description": "Permanent agent API key. Shown once.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "agent_wallet_pda",
                    "api_key"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [],
        "summary": "Redeem an invitation code for an API key",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/api/v1/swap": {
      "post": {
        "description": "Quotes the swap via the configured aggregator and executes it under operator-defined spend limits. The minimum-out guarantee is enforced by the runtime.",
        "operationId": "swap",
        "parameters": [
          {
            "description": "Reuse the same value on retry. Generating a new key submits a duplicate request.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "description": "Token amount in human units. Six-decimal precision.",
                    "minimum": 0,
                    "type": "number"
                  },
                  "from_mint": {
                    "description": "Opaque token identifier (base58).",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  },
                  "from_token": {
                    "description": "Human-readable source symbol (e.g. \"USDC\").",
                    "type": "string"
                  },
                  "idempotency_key": {
                    "description": "Required. Reuse the same key on retry. Generating a new key submits a duplicate swap.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "minimum_amount_out": {
                    "description": "Minimum acceptable output. Defaults to the aggregator's quoted out-amount.",
                    "minimum": 0,
                    "type": "number"
                  },
                  "slippage_bps": {
                    "default": 50,
                    "description": "Max slippage in basis points.",
                    "maximum": 10000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "task_id": {
                    "type": "string"
                  },
                  "to_mint": {
                    "description": "Opaque token identifier (base58).",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  },
                  "to_token": {
                    "description": "Human-readable destination symbol (e.g. \"SOL\").",
                    "type": "string"
                  }
                },
                "required": [
                  "from_token",
                  "to_token",
                  "from_mint",
                  "to_mint",
                  "amount",
                  "idempotency_key"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "daily_remaining": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "hourly_tx_remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "rate": {
                      "description": "Effective out / in rate.",
                      "type": "number"
                    },
                    "received_amount": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "status": {
                      "enum": [
                        "confirmed"
                      ],
                      "type": "string"
                    },
                    "tx_sig": {
                      "$ref": "#/components/schemas/enclz.TxReceipt"
                    }
                  },
                  "required": [
                    "tx_sig",
                    "status",
                    "received_amount",
                    "rate",
                    "daily_remaining",
                    "hourly_tx_remaining"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Swap one token for another with a minimum-out guarantee",
        "tags": [
          "intents"
        ]
      }
    },
    "/api/v1/transfer": {
      "post": {
        "description": "Submits a transfer to a recipient on the operator-managed allow-list. The operator-defined per-tx, daily, and hourly limits are enforced. A 0.10 % protocol fee is deducted automatically; `net_amount` is what the recipient receives.",
        "operationId": "transfer",
        "parameters": [
          {
            "description": "Reuse the same value on retry. Generating a new key submits a duplicate request.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "description": "Token amount in human units. Six-decimal precision.",
                    "minimum": 0,
                    "type": "number"
                  },
                  "idempotency_key": {
                    "description": "Required. Reuse the same key on retry. Generating a new key submits a duplicate transfer.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "memo": {
                    "description": "Free-form memo, surfaced in webhook payload.",
                    "type": "string"
                  },
                  "mint": {
                    "description": "Optional token override.",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  },
                  "task_id": {
                    "description": "Caller-defined task identifier.",
                    "type": "string"
                  },
                  "to": {
                    "description": "Opaque recipient identifier. Must be in the operator-managed allow-list.",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  }
                },
                "required": [
                  "to",
                  "amount",
                  "idempotency_key"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "daily_remaining": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "hourly_tx_remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "net_amount": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "protocol_fee": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "status": {
                      "enum": [
                        "confirmed"
                      ],
                      "type": "string"
                    },
                    "tx_sig": {
                      "$ref": "#/components/schemas/enclz.TxReceipt"
                    }
                  },
                  "required": [
                    "tx_sig",
                    "status",
                    "net_amount",
                    "protocol_fee",
                    "daily_remaining",
                    "hourly_tx_remaining"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Send tokens to an allow-listed recipient",
        "tags": [
          "intents"
        ]
      }
    },
    "/api/v1/webhooks": {
      "post": {
        "operationId": "registerWebhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "event_types": {
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "url": {
                    "format": "uri",
                    "pattern": "^https://",
                    "type": "string"
                  }
                },
                "required": [
                  "url",
                  "event_types"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "signing_secret": {
                      "description": "HMAC-SHA256 signing secret. Returned exactly once.",
                      "type": "string"
                    },
                    "webhook_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "webhook_id",
                    "signing_secret"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Register an HTTPS webhook subscriber for this agent",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/withdraw": {
      "post": {
        "operationId": "withdraw",
        "parameters": [
          {
            "description": "Reuse the same value on retry. Generating a new key submits a duplicate request.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "description": "Token amount in human units. Six-decimal precision.",
                    "minimum": 0,
                    "type": "number"
                  },
                  "cpi_data": {
                    "description": "Opaque instruction body forwarded to the lending venue.",
                    "items": {
                      "maximum": 255,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "idempotency_key": {
                    "description": "Required. Reuse the same key on retry. Generating a new key submits a duplicate operation.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "lending_program": {
                    "description": "Identifier of an allow-listed lending venue.",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  },
                  "mint": {
                    "description": "Opaque token identifier (base58).",
                    "maxLength": 44,
                    "minLength": 32,
                    "type": "string"
                  }
                },
                "required": [
                  "amount",
                  "lending_program",
                  "idempotency_key"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "received_amount": {
                      "description": "Token amount in human units. Six-decimal precision.",
                      "minimum": 0,
                      "type": "number"
                    },
                    "status": {
                      "enum": [
                        "confirmed"
                      ],
                      "type": "string"
                    },
                    "tx_sig": {
                      "$ref": "#/components/schemas/enclz.TxReceipt"
                    }
                  },
                  "required": [
                    "tx_sig",
                    "status",
                    "received_amount"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enclz.ErrorResponse"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Withdraw from an allow-listed lending venue",
        "tags": [
          "intents"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://enclz.com"
    },
    {
      "description": "Local development",
      "url": "http://localhost:3001"
    }
  ],
  "tags": [
    {
      "description": "One-time agent registration via invitation code.",
      "name": "onboarding"
    },
    {
      "description": "Run an operation under operator-defined spend limits.",
      "name": "intents"
    },
    {
      "description": "Read agent balances, limits, and recent activity.",
      "name": "state"
    },
    {
      "description": "Subscribe to agent-scoped event webhooks.",
      "name": "webhooks"
    }
  ]
}
