{
  "openapi": "3.1.0",
  "info": {
    "title": "DARKOZA Developer API",
    "version": "1.0.0",
    "description": "Developer API access and model inference are temporarily paused. No free keys or compute are available while paid billing and per-key entitlements are not implemented. Health and readiness endpoints remain public; existing key revocation remains available."
  },
  "servers": [
    {
      "url": "https://darkoza.com/asi-api"
    }
  ],
  "security": [
    {
      "BearerApiKey": []
    }
  ],
  "paths": {
    "/v1": {
      "get": {
        "security": [],
        "summary": "API version metadata",
        "responses": {
          "200": {
            "description": "API metadata"
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "security": [],
        "summary": "Gateway liveness",
        "responses": {
          "200": {
            "description": "Gateway is running"
          }
        }
      }
    },
    "/v1/ready": {
      "get": {
        "security": [],
        "summary": "Gateway and engine readiness",
        "responses": {
          "200": {
            "description": "Engine ready"
          },
          "503": {
            "description": "Engine unavailable"
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "security": [],
        "summary": "List supported model aliases",
        "responses": {
          "200": {
            "description": "Model list"
          }
        }
      }
    },
    "/v1/keys": {
      "post": {
        "security": [],
        "deprecated": true,
        "summary": "Unavailable: paid key issuance is paused",
        "description": "Key issuance returns HTTP 503 until paid billing and per-key entitlements are implemented and independently verified.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 48
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "503": {
            "description": "Paid billing and per-key entitlements are not ready; key issuance is paused."
          }
        }
      }
    },
    "/v1/keys/revoke": {
      "post": {
        "summary": "Revoke one key",
        "description": "Use that key's management token, or the API key itself to revoke the same key. The operation is idempotent.",
        "responses": {
          "200": {
            "description": "Key revoked or already revoked"
          },
          "401": {
            "description": "Invalid credential"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "summary": "Read usage for the authenticated key",
        "responses": {
          "200": {
            "description": "Rolling one-hour usage summary"
          },
          "401": {
            "description": "Invalid or revoked key"
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "deprecated": true,
        "summary": "Unavailable: model inference is paused",
        "description": "Model inference returns HTTP 503 until commercial billing and per-key entitlements are implemented and independently verified.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "const": "darkoza"
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 24,
                    "items": {
                      "$ref": "#/components/schemas/Message"
                    }
                  },
                  "task": {
                    "type": "string",
                    "enum": [
                      "chat",
                      "quick",
                      "reasoning",
                      "artifact",
                      "coding",
                      "imagination",
                      "goal_plan",
                      "analysis"
                    ],
                    "default": "chat",
                    "description": "analysis and goal_plan are routed through the reasoning profile."
                  },
                  "stream": {
                    "type": "boolean",
                    "const": false
                  },
                  "web_search": {
                    "type": "boolean",
                    "default": false,
                    "description": "General web search is not yet available through Developer API v1. Set false; true returns HTTP 501."
                  },
                  "output_language": {
                    "type": "string",
                    "maxLength": 60
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "503": {
            "description": "Paid billing and per-key entitlements are not ready; model inference is paused. No request reaches the model engine."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "DARKOZA API key"
      }
    },
    "schemas": {
      "Message": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {
            "type": "string",
            "maxLength": 4000
          }
        },
        "additionalProperties": false
      }
    }
  }
}
