{
  "openapi": "3.1.0",
  "info": {
    "title": "Grok Agent Store",
    "version": "1.0.0",
    "description": "Agent-only vertical skill store. Grok-backed tools sold per call. Prefer /skills.json then /v1/invoke.",
    "contact": {
      "url": "https://github.com/manhatton31-svg/grok-agent-store"
    }
  },
  "servers": [
    {
      "url": "https://grok-agent-store.manhatton31.workers.dev"
    }
  ],
  "externalDocs": {
    "description": "Machine instructions for agents",
    "url": "https://grok-agent-store.manhatton31.workers.dev/llms.txt"
  },
  "paths": {
    "/skills.json": {
      "get": {
        "operationId": "listSkills",
        "summary": "Skill graph",
        "tags": [
          "discovery"
        ],
        "responses": {
          "200": {
            "description": "Skill catalog"
          }
        }
      }
    },
    "/discovery.json": {
      "get": {
        "operationId": "discoveryIndex",
        "summary": "All discovery endpoints in one document",
        "tags": [
          "discovery"
        ],
        "responses": {
          "200": {
            "description": "Discovery index"
          }
        }
      }
    },
    "/v1/invoke": {
      "post": {
        "operationId": "invokeSkill",
        "summary": "Invoke a skill",
        "tags": [
          "commerce"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "skill_id"
                ],
                "properties": {
                  "skill_id": {
                    "type": "string"
                  },
                  "input": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoke result with optional receipt"
          },
          "402": {
            "description": "Insufficient credits"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP Streamable HTTP endpoint",
        "tags": [
          "mcp"
        ],
        "responses": {
          "200": {
            "description": "MCP session"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key from register_agent"
      }
    }
  },
  "tags": [
    {
      "name": "discovery"
    },
    {
      "name": "commerce"
    },
    {
      "name": "mcp"
    }
  ]
}