{
 "openapi": "3.1.0",
 "info": {
  "title": "Zanii LLM",
  "version": "0.1.0",
  "description": "An OpenAI-compatible inference API from a UAE company, where every call is a signed receipt on a public ledger you can verify yourself.",
  "contact": {
   "email": "info@zanii.agency",
   "url": "https://llm.zanii.agency"
  }
 },
 "servers": [
  {
   "url": "https://llm.zanii.agency/v1"
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "http",
    "scheme": "bearer"
   }
  }
 },
 "security": [
  {
   "apiKey": []
  }
 ],
 "paths": {
  "/chat/completions": {
   "post": {
    "summary": "Create a chat completion",
    "description": "OpenAI-compatible. Returns X-Zanii-Receipt-Hash when the key has receipts enabled.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "model",
         "messages"
        ],
        "properties": {
         "model": {
          "type": "string",
          "enum": [
           "glm-4.7-flash",
           "qwen3.8-27b"
          ]
         },
         "messages": {
          "type": "array",
          "items": {
           "type": "object"
          }
         },
         "stream": {
          "type": "boolean"
         },
         "max_tokens": {
          "type": "integer"
         },
         "tools": {
          "type": "array",
          "items": {
           "type": "object"
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "A completion"
     },
     "402": {
      "description": "Insufficient credit"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   }
  },
  "/models": {
   "get": {
    "summary": "List the models this key may call",
    "responses": {
     "200": {
      "description": "The catalogue with prices"
     }
    }
   }
  },
  "/usage": {
   "get": {
    "summary": "What this key's account has spent",
    "responses": {
     "200": {
      "description": "Totals and recent calls"
     }
    }
   }
  },
  "/balance": {
   "get": {
    "summary": "What credit is left",
    "responses": {
     "200": {
      "description": "Balance in micro-AED"
     }
    }
   }
  }
 }
}