{
  "openapi": "3.1.0",
  "info": {
    "title": "5xGPT Public Content API",
    "version": "1.0.0",
    "description": "Read-only public endpoints for discovering 5xGPT service configuration and published articles. Checkout, payment, account, and administrative workflows are intentionally not offered as a third-party agent API.",
    "contact": {
      "name": "5xGPT Support",
      "email": "support@5xgpt.com",
      "url": "https://www.5xgpt.com/developers/"
    }
  },
  "servers": [
    {
      "url": "https://www.5xgpt.com",
      "description": "5xGPT production"
    }
  ],
  "externalDocs": {
    "description": "5xGPT developer resources and agent access guide",
    "url": "https://www.5xgpt.com/developers/"
  },
  "tags": [
    {
      "name": "Store",
      "description": "Public display configuration used by the 5xGPT site. Prices and availability can change."
    },
    {
      "name": "Articles",
      "description": "Published 5xGPT support and product-guide content."
    }
  ],
  "paths": {
    "/api/store": {
      "get": {
        "operationId": "getPublicStore",
        "summary": "Get public 5xGPT site configuration",
        "description": "Returns the public display configuration used by the website. This endpoint does not create orders or expose private operational data.",
        "tags": ["Store"],
        "responses": {
          "200": {
            "description": "Current public site configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/articles": {
      "get": {
        "operationId": "listPublishedArticles",
        "summary": "List published 5xGPT articles",
        "description": "Returns articles that are currently public. Offline or administrative article data is excluded.",
        "tags": ["Articles"],
        "responses": {
          "200": {
            "description": "Published articles in display order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["articles"],
                  "properties": {
                    "articles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Article"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/articles/{slug}": {
      "get": {
        "operationId": "getPublishedArticle",
        "summary": "Get a published 5xGPT article",
        "description": "Returns one public article identified by its URL slug.",
        "tags": ["Articles"],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Published article slug",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published article",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["article"],
                  "properties": {
                    "article": {
                      "$ref": "#/components/schemas/Article"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StoreResponse": {
        "type": "object",
        "required": ["store"],
        "properties": {
          "store": {
            "type": "object",
            "description": "Public site configuration. Fields may be extended without a version change.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "Article": {
        "type": "object",
        "required": ["slug", "title"],
        "properties": {
          "slug": {
            "type": "string",
            "description": "Stable article URL slug"
          },
          "title": {
            "type": "string"
          },
          "desc": {
            "type": "string",
            "description": "Short article description"
          },
          "lead": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "description": "Article body as sanitized HTML"
          },
          "date": {
            "type": "string",
            "description": "Publication date"
          },
          "author": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "description": "Root-relative or absolute cover image URL"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pinned": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "required": ["error", "errorCode", "message", "resolution"],
        "properties": {
          "error": {
            "type": "string",
            "description": "Legacy-compatible human-readable error text"
          },
          "errorCode": {
            "type": "string",
            "description": "Stable machine-readable error category",
            "examples": ["api_not_found"]
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation"
          },
          "resolution": {
            "type": "string",
            "description": "A concrete recovery or retry hint"
          }
        },
        "additionalProperties": true
      }
    },
    "responses": {
      "ErrorResponse": {
        "description": "Structured JSON error with a machine-readable code and recovery hint",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "API endpoint not found",
              "errorCode": "api_not_found",
              "message": "API endpoint not found",
              "resolution": "Use https://www.5xgpt.com/openapi.json to choose a documented endpoint."
            }
          }
        }
      }
    }
  }
}
