{
  "openapi": "3.1.0",
  "info": {
    "title": "Relixr API",
    "version": "1.0.0",
    "description": "OpenAI-compatible inference gateway plus Relixr management surfaces. Customer base URL: https://api.relixr.com/v1"
  },
  "servers": [
    { "url": "https://api.relixr.com/v1", "description": "Public inference API" }
  ],
  "paths": {
    "/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Create a chat completion",
        "security": [{ "bearerAuth": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "messages"],
                "properties": {
                  "model": { "type": "string" },
                  "messages": { "type": "array", "items": { "type": "object" } },
                  "stream": { "type": "boolean" },
                  "temperature": { "type": "number" },
                  "max_tokens": { "type": "integer" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Completion (may include relixr routing/cost extension)" },
          "401": { "description": "Invalid or missing key" },
          "402": { "description": "Insufficient balance" },
          "403": { "description": "Policy violation" }
        }
      }
    },
    "/embeddings": {
      "post": {
        "operationId": "createEmbedding",
        "summary": "Create embeddings",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Embedding response" }
        }
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List available models",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Model list with pricing and availability" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "rlx_…"
      }
    }
  }
}
