{
  "openapi": "3.1.0",
  "info": {
    "title": "AI API Kit API",
    "version": "2026-06-01"
  },
  "servers": [
    {
      "url": "https://api.aiapikit.com/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "summary": "Current workspace and plan",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/keys": {
      "get": {
        "summary": "List keys (prefix and last 4 only)",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      },
      "post": {
        "summary": "Create a key",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/keys/{id}/rotate": {
      "post": {
        "summary": "Rotate a key",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/keys/{id}": {
      "delete": {
        "summary": "Revoke a key",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "summary": "Token usage and cost",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/projects": {
      "get": {
        "summary": "List projects",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/routes": {
      "get": {
        "summary": "Routing rules",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/routes/{alias}": {
      "put": {
        "summary": "Create or replace a route",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/audit-log": {
      "get": {
        "summary": "Audit log (Team and Scale)",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    },
    "/webhooks": {
      "post": {
        "summary": "Register a webhook",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Invalid key"
          }
        }
      }
    }
  }
}
