{
  "openapi": "3.1.0",
  "info": {
    "title": "AmericanUAS Real-World Drone Data Collection API",
    "version": "1.0.0",
    "description": "AmericanUAS (A3RO LLC DBA AmericanUAS) is a nationwide US drone operations contractor. AI agents can hire FAA Part 107 certified crews for real-world, in-person (IRL) physical data collection on Earth: aerial photo/video, thermal, LiDAR, photogrammetry, mapping, inspections, and field data capture. Quote on request; pay in USDC on Base, ETH, or BTC with automatic on-chain verification.",
    "contact": {
      "email": "luke@americanuas.com",
      "url": "https://americanuas.com/ai-services.html"
    }
  },
  "servers": [
    {
      "url": "https://jvxlcethiotiesxmbkes.supabase.co/functions/v1/agent-services"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getCatalog",
        "summary": "List services, coverage, payment methods",
        "responses": {
          "200": {
            "description": "Service catalog"
          }
        }
      },
      "post": {
        "operationId": "requestService",
        "summary": "Request a quote for real-world drone data collection (no auth)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "service_id",
                  "client_email",
                  "location",
                  "scope"
                ],
                "properties": {
                  "service_id": {
                    "type": "string"
                  },
                  "agent_name": {
                    "type": "string"
                  },
                  "client_name": {
                    "type": "string"
                  },
                  "client_email": {
                    "type": "string"
                  },
                  "client_organization": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "desired_dates": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string"
                  },
                  "deliverables": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request created; returns id, api_key and request_token (shown once)"
          }
        }
      }
    },
    "/requests": {
      "get": {
        "operationId": "listRequests",
        "summary": "List requests for this agent account",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Requests"
          }
        }
      }
    },
    "/requests/{id}": {
      "get": {
        "operationId": "getRequest",
        "summary": "Quote, status, payment instructions, timeline",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request"
          }
        }
      }
    },
    "/requests/{id}/accept": {
      "post": {
        "operationId": "acceptQuote",
        "summary": "Accept quote and choose chain",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "enum": [
                      "BASE_USDC",
                      "BASE_ETH",
                      "ETH",
                      "BTC"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment instructions"
          }
        }
      }
    },
    "/requests/{id}/payment": {
      "post": {
        "operationId": "submitPayment",
        "summary": "Submit transaction hash; verified on-chain automatically",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string"
                  },
                  "tx_hash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification result"
          }
        }
      }
    },
    "/requests/{id}/messages": {
      "post": {
        "operationId": "sendMessage",
        "summary": "Message the AmericanUAS team",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Logged"
          }
        }
      }
    },
    "/requests/{id}/cancel": {
      "post": {
        "operationId": "cancelRequest",
        "summary": "Cancel a request",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "auas_key_ (account) or auas_req_ (single request) token issued on first order"
      }
    }
  }
}