{
  "openapi": "3.0.0",
  "info": {
    "title": "FireAPI",
    "description": "The Ultimate API Marketplace & Tool Hub. Discover, build, and monetize APIs and tools with seamless SSO integration.",
    "version": "1.0.0",
    "contact": {
      "name": "FireAPI Support",
      "url": "https://fireapi.io/contact"
    }
  },
  "servers": [
    {
      "url": "https://api.fireapi.io",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/users/app-tools": {
      "get": {
        "summary": "Search Public Marketplace",
        "description": "Fetches a paginated list of all publicly available tools and apps in the FireAPI marketplace.",
        "tags": [
          "Marketplace"
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "Search term for tool name or category",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Filter by specific category",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful search response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tools": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Tool"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/sso/verify": {
      "post": {
        "summary": "Verify SSO Token",
        "description": "Validates a FireAPI SSO token and returns rich metadata about the user and their tool subscription.",
        "tags": [
          "Authentication"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "example": "sso_6c9f..."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token verification successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SSOResponse"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      }
    },
    "schemas": {
      "Tool": {
        "type": "object",
        "properties": {
          "tool_id": {
            "type": "integer"
          },
          "tool_name": {
            "type": "string"
          },
          "tool_slug": {
            "type": "string"
          },
          "tool_description": {
            "type": "string"
          },
          "tool_category": {
            "type": "string"
          },
          "starting_price": {
            "type": "number",
            "nullable": true
          }
        }
      },
      "SSOResponse": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "email": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "tool": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          },
          "subscription": {
            "type": "object",
            "properties": {
              "user_tool_id": {
                "type": "string"
              },
              "is_trial": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}