{
  "openapi": "3.1.0",
  "info": {
    "title": "BlueWave Public API",
    "version": "1.0.0",
    "summary": "Public discovery API for BlueWave agency ad accounts",
    "description": "Public discovery and status endpoints for BlueWave. Agency ad-account provisioning is human-mediated via Telegram (@bluewave_mngr); there is no self-serve checkout API.\n\nDeprecation policy: https://bluewave-agency.com/api/deprecation.md",
    "contact": {
      "name": "BlueWave",
      "url": "https://t.me/bluewave_mngr"
    }
  },
  "servers": [
    {
      "url": "https://bluewave-agency.com",
      "description": "Production"
    }
  ],
  "tags": [
    { "name": "Discovery" },
    { "name": "Agents" }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "tags": ["Discovery"],
        "summary": "Service health",
        "responses": {
          "200": {
            "description": "Service is reachable",
            "headers": {
              "RateLimit-Limit": { "schema": { "type": "integer" } },
              "RateLimit-Remaining": { "schema": { "type": "integer" } },
              "RateLimit-Reset": { "schema": { "type": "integer" } }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HealthResponse" }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/api/v1/info": {
      "get": {
        "operationId": "getInfo",
        "tags": ["Discovery"],
        "summary": "Public BlueWave facts for agents",
        "responses": {
          "200": {
            "description": "Public company and contact facts",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/InfoResponse" }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/agent/register": {
      "get": {
        "operationId": "getAgentRegister",
        "tags": ["Agents"],
        "summary": "Anonymous agent registration discovery",
        "responses": {
          "200": {
            "description": "Registration methods and contact for human provisioning",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegisterResponse" }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postAgentRegister",
        "tags": ["Agents"],
        "summary": "Anonymous registration (no credentials issued)",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": { "type": "string", "maxLength": 128 },
            "description": "Optional idempotency key; echoed back when present"
          }
        ],
        "responses": {
          "200": {
            "description": "Anonymous access acknowledged",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegisterResponse" }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/a2a/v1": {
      "post": {
        "operationId": "a2aMessage",
        "tags": ["Agents"],
        "summary": "A2A HTTP+JSON message endpoint",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/A2ARequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/A2AResponse" }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "required": ["status", "service", "time"],
        "properties": {
          "status": { "type": "string", "enum": ["ok"] },
          "service": { "type": "string" },
          "time": { "type": "string", "format": "date-time" }
        },
        "additionalProperties": false
      },
      "InfoResponse": {
        "type": "object",
        "required": ["name", "url", "contact", "platforms", "llms", "auth", "pricing"],
        "properties": {
          "name": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "contact": { "type": "string", "format": "uri" },
          "platforms": {
            "type": "array",
            "items": { "type": "string" }
          },
          "fees": {
            "type": "object",
            "properties": {
              "tiers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rate": { "type": "number" },
                    "monthly_volume_usd": { "type": "string" }
                  }
                }
              },
              "minimum_topup_usd": { "type": "number" },
              "test_topup_usd": { "type": "number" },
              "payment": { "type": "string" }
            }
          },
          "llms": { "type": "string", "format": "uri" },
          "auth": { "type": "string", "format": "uri" },
          "pricing": { "type": "string", "format": "uri" },
          "openapi": { "type": "string", "format": "uri" },
          "api_catalog": { "type": "string", "format": "uri" },
          "developers": { "type": "string", "format": "uri" }
        },
        "additionalProperties": false
      },
      "RegisterResponse": {
        "type": "object",
        "required": ["type", "status", "message", "credential_types_supported", "contact"],
        "properties": {
          "type": { "type": "string", "enum": ["anonymous"] },
          "status": { "type": "string", "enum": ["ok"] },
          "message": { "type": "string" },
          "credential_types_supported": {
            "type": "array",
            "items": { "type": "string" }
          },
          "contact": { "type": "string", "format": "uri" },
          "claim_uri": { "type": "string", "format": "uri" },
          "auth_md": { "type": "string", "format": "uri" },
          "idempotency_key": { "type": ["string", "null"] }
        },
        "additionalProperties": false
      },
      "A2ARequest": {
        "type": "object",
        "required": ["skill"],
        "properties": {
          "skill": { "type": "string", "enum": ["public-info", "health"] },
          "message": { "type": "string" }
        },
        "additionalProperties": false
      },
      "A2AResponse": {
        "type": "object",
        "required": ["ok", "skill", "result"],
        "properties": {
          "ok": { "type": "boolean" },
          "skill": { "type": "string" },
          "result": { "type": "object" }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error", "message"],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "not_found",
              "bad_request",
              "unauthorized_client",
              "method_not_allowed",
              "misdirected_request"
            ]
          },
          "message": { "type": "string" },
          "docs": { "type": "string", "format": "uri" }
        },
        "additionalProperties": false
      }
    }
  }
}
