{
  "openapi": "3.1.0",
  "info": {
    "title": "Agentasy agent inquiry API",
    "version": "1.0.0",
    "summary": "Send a project inquiry to Agentasy on behalf of the person you are helping.",
    "description": "For AI agents acting for a person. Use it only when that person has asked you to contact Agentasy, with their own name and email address. A person at Agentasy replies to that address by email, usually within one working day. Agentasy only emails its own team when an inquiry arrives; it never emails the address in the inquiry automatically. The same tool is available over MCP at https://agentasy.ai/mcp.",
    "contact": { "name": "Agentasy", "email": "hello@agentasy.ai", "url": "https://agentasy.ai/" }
  },
  "externalDocs": { "url": "https://agentasy.ai/agent-api.md" },
  "servers": [{ "url": "https://agentasy.ai" }],
  "paths": {
    "/api/agent/inquiry": {
      "post": {
        "operationId": "sendInquiry",
        "summary": "Send a project inquiry",
        "description": "Limits: 2 requests per minute per IP address, and a shared daily cap across all agents. No authentication.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Inquiry" } } }
        },
        "responses": {
          "200": {
            "description": "Sent to the Agentasy team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["ok", "message"],
                  "properties": { "ok": { "const": true }, "message": { "type": "string" } }
                }
              }
            }
          },
          "400": { "description": "Malformed JSON (bad_request) or invalid fields (invalid_fields, with per-field errors).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "413": { "description": "Body over 16 KB (too_large).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "429": {
            "description": "Too many requests from this address, or the daily cap is reached (rate_limited). Retry-After says when to try again; or ask the person to write to hello@agentasy.ai.",
            "headers": { "Retry-After": { "schema": { "type": "integer" }, "description": "Seconds" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "502": { "description": "The mail service failed (send_failed). Ask the person to write to hello@agentasy.ai.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agent/health": {
      "get": {
        "operationId": "health",
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "The API is up.",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "const": "ok" } } } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Inquiry": {
        "type": "object",
        "required": ["name", "email", "message"],
        "additionalProperties": false,
        "properties": {
          "name": { "type": "string", "maxLength": 100, "description": "Full name of the person you are acting for." },
          "email": { "type": "string", "format": "email", "maxLength": 200, "description": "Their email address; the reply goes here." },
          "company": { "type": "string", "maxLength": 120, "description": "Their company, if any." },
          "message": { "type": "string", "minLength": 10, "maxLength": 4000, "description": "What they would like to hand off to an agent, in their words: the work, the systems involved, and what must not go wrong." },
          "agent": { "type": "string", "maxLength": 100, "description": "Your own name as an assistant, e.g. \"Claude\"." },
          "lang": { "type": "string", "enum": ["en", "zh-Hant-TW", "ja"], "default": "en", "description": "Language the person prefers for the reply." }
        }
      },
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "type": "string", "enum": ["bad_request", "invalid_fields", "too_large", "rate_limited", "send_failed"] },
          "errors": {
            "type": "object",
            "description": "Per field, when error is invalid_fields.",
            "additionalProperties": { "type": "string", "enum": ["required", "invalid", "too_short", "too_long"] }
          }
        }
      }
    }
  }
}
