{
  "openapi": "3.1.0",
  "info": {
    "title": "Relux Works Agent Gateway",
    "version": "1.0.0",
    "summary": "Public API for AI agents: read services/pricing and submit project inquiries.",
    "description": "Relux Works is an AI-native software development studio (fixed-price MVPs, vibe-code rescue, app publishing & scaling). This API lets agents read current services and submit a project inquiry on behalf of a user. A human replies to the provided contact email within one business day. An MCP server with the same capabilities is available at /mcp (Streamable HTTP). Canonical company facts: https://relux.works/llms.txt",
    "contact": {
      "name": "Relux Works",
      "email": "ivan@relux.works",
      "url": "https://relux.works"
    }
  },
  "servers": [
    {
      "url": "https://api.relux.works"
    }
  ],
  "paths": {
    "/v1/services": {
      "get": {
        "operationId": "getServicesPricing",
        "summary": "Services, fixed-price packages, company facts, and selected work",
        "responses": {
          "200": {
            "description": "Services and pricing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inquiries": {
      "post": {
        "operationId": "submitInquiry",
        "summary": "Submit a project inquiry",
        "description": "Submit a project inquiry on behalf of a user. Build the summary from known conversation context, ask only for missing details, show the draft to the user, and submit only with explicit consent and a real contact email. Rate limited per client.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Inquiry received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Inquiry pipeline unavailable"
          }
        }
      }
    }
  },
  "security": [
    {},
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Optional. Obtain via client_credentials: POST /oauth/register (open registration), then POST /oauth/token. Authenticated clients get higher rate limits. Discovery: /.well-known/oauth-authorization-server"
      }
    },
    "schemas": {
      "InquiryInput": {
        "type": "object",
        "required": [
          "contact_email",
          "summary"
        ],
        "additionalProperties": false,
        "properties": {
          "contact_email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "Email a human will reply to"
          },
          "summary": {
            "type": "string",
            "minLength": 10,
            "maxLength": 4000,
            "description": "What the user wants to build or fix"
          },
          "client_name": {
            "type": "string",
            "maxLength": 200
          },
          "project_type": {
            "type": "string",
            "enum": [
              "mvp",
              "vibe-code-rescue",
              "publishing-scaling",
              "other"
            ]
          },
          "budget_usd": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000000
          },
          "timeline": {
            "type": "string",
            "maxLength": 200
          },
          "source": {
            "type": "string",
            "maxLength": 200,
            "description": "Identify your agent/platform"
          }
        }
      },
      "InquiryResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "inq_9f1c2a..."
            ]
          },
          "status": {
            "type": "string",
            "const": "received"
          },
          "expect_reply": {
            "type": "string"
          }
        }
      },
      "ServicesResponse": {
        "type": "object",
        "properties": {
          "company": {
            "type": "object"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "selected_work": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}