{
  "openapi": "3.1.0",
  "info": {
    "title": "MACROSTRATEGIES",
    "version": "2026-10-28",
    "summary": "Public account API on macrostrategies.ai.",
    "description": "Public routes on macrostrategies.ai: account signup and status, and a health check. Paid machine APIs are GEDX402 (https://gedx402.com/openapi.json, x402 discovery at https://gedx402.com/.well-known/x402). This document does not list prices.",
    "contact": { "name": "MACROSTRATEGIES LLC", "url": "https://macrostrategies.ai" }
  },
  "servers": [{ "url": "https://macrostrategies.ai" }],
  "externalDocs": { "description": "Agent guide", "url": "https://macrostrategies.ai/llms.txt" },
  "paths": {
    "/api/agents/signup": {
      "post": {
        "operationId": "createAccount",
        "summary": "Create an account with a name and an email.",
        "description": "Do not send an account id. The same email again returns 200 and the existing token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "email"],
                "properties": {
                  "name": { "type": "string" },
                  "email": { "type": "string", "format": "email" }
                }
              },
              "example": { "name": "Ada Lovelace", "email": "ada@example.com" }
            }
          }
        },
        "responses": {
          "200": { "description": "Existing account for this email.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } } },
          "202": { "description": "Account created, pending.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } } },
          "400": { "description": "Bad request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "409": { "description": "Already taken.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      },
      "get": {
        "operationId": "getAccountStatus",
        "summary": "Account status by token.",
        "description": "Poll until status is ready; the JSON then includes welcome.",
        "parameters": [
          { "name": "token", "in": "query", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Account status.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } } },
          "404": { "description": "Unknown token.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agents/health": {
      "get": {
        "operationId": "health",
        "summary": "Health check.",
        "responses": {
          "200": {
            "description": "Healthy.",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": ["ok"] } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Account": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "status": { "type": "string" },
          "token": { "type": "string" },
          "welcome": {}
        }
      },
      "Error": {
        "type": "object",
        "properties": { "error": { "type": "string" } },
        "required": ["error"]
      }
    }
  }
}
