openapi: 3.1.0 info: title: Api version: 0.1.0 description: Luxi IDE API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: projects description: Project management - name: files description: File management within projects - name: conversations description: Chat conversation history - name: ai description: AI coding assistant - name: admin description: Admin operations paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /projects: get: operationId: listProjects tags: [projects] summary: List all projects responses: "200": description: List of projects content: application/json: schema: type: array items: $ref: "#/components/schemas/Project" post: operationId: createProject tags: [projects] summary: Create a new project requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateProjectBody" responses: "201": description: Created project content: application/json: schema: $ref: "#/components/schemas/Project" /projects/{id}: get: operationId: getProject tags: [projects] summary: Get a project parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Project details content: application/json: schema: $ref: "#/components/schemas/Project" "404": description: Not found patch: operationId: updateProject tags: [projects] summary: Update a project parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateProjectBody" responses: "200": description: Updated project content: application/json: schema: $ref: "#/components/schemas/Project" "404": description: Not found delete: operationId: deleteProject tags: [projects] summary: Delete a project parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /projects/{projectId}/files: get: operationId: listFiles tags: [files] summary: List files in a project parameters: - name: projectId in: path required: true schema: type: integer responses: "200": description: List of files content: application/json: schema: type: array items: $ref: "#/components/schemas/ProjectFile" post: operationId: createFile tags: [files] summary: Create a new file in a project parameters: - name: projectId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateFileBody" responses: "201": description: Created file content: application/json: schema: $ref: "#/components/schemas/ProjectFile" /projects/{projectId}/files/{fileId}: get: operationId: getFile tags: [files] summary: Get a file with its content parameters: - name: projectId in: path required: true schema: type: integer - name: fileId in: path required: true schema: type: integer responses: "200": description: File with content content: application/json: schema: $ref: "#/components/schemas/ProjectFile" "404": description: Not found put: operationId: updateFile tags: [files] summary: Update file content parameters: - name: projectId in: path required: true schema: type: integer - name: fileId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateFileBody" responses: "200": description: Updated file content: application/json: schema: $ref: "#/components/schemas/ProjectFile" "404": description: Not found delete: operationId: deleteFile tags: [files] summary: Delete a file parameters: - name: projectId in: path required: true schema: type: integer - name: fileId in: path required: true schema: type: integer responses: "204": description: Deleted /projects/{projectId}/conversations: get: operationId: listConversations tags: [conversations] summary: List conversations for a project parameters: - name: projectId in: path required: true schema: type: integer responses: "200": description: List of conversations content: application/json: schema: type: array items: $ref: "#/components/schemas/Conversation" post: operationId: createConversation tags: [conversations] summary: Create a new conversation parameters: - name: projectId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateConversationBody" responses: "201": description: Created conversation content: application/json: schema: $ref: "#/components/schemas/Conversation" /conversations/{conversationId}: patch: operationId: updateConversation tags: [conversations] summary: Update conversation title parameters: - name: conversationId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateConversationBody" responses: "200": description: Updated conversation content: application/json: schema: $ref: "#/components/schemas/Conversation" delete: operationId: deleteConversation tags: [conversations] summary: Delete a conversation parameters: - name: conversationId in: path required: true schema: type: integer responses: "204": description: Deleted /conversations/{conversationId}/messages: get: operationId: listMessages tags: [conversations] summary: List messages in a conversation parameters: - name: conversationId in: path required: true schema: type: integer responses: "200": description: List of messages content: application/json: schema: type: array items: $ref: "#/components/schemas/ConversationMessage" post: operationId: createMessage tags: [conversations] summary: Add a message to a conversation parameters: - name: conversationId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateMessageBody" responses: "201": description: Created message content: application/json: schema: $ref: "#/components/schemas/ConversationMessage" /ai/chat: post: operationId: aiChat tags: [ai] summary: Send a message to the AI coding assistant (SSE streaming) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AiChatBody" responses: "200": description: SSE stream of AI response "400": description: Bad request "503": description: AI not configured /admin/settings: get: operationId: getAdminSettings tags: [admin] summary: Get admin settings responses: "200": description: Admin settings content: application/json: schema: $ref: "#/components/schemas/AdminSettings" "401": description: Unauthorized put: operationId: updateAdminSettings tags: [admin] summary: Update admin settings (requires LUXI:LUXI auth) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateAdminSettingsBody" responses: "200": description: Updated settings content: application/json: schema: $ref: "#/components/schemas/AdminSettings" "401": description: Unauthorized /admin/stats: get: operationId: getAdminStats tags: [admin] summary: Get platform statistics responses: "200": description: Platform stats content: application/json: schema: $ref: "#/components/schemas/AdminStats" "401": description: Unauthorized components: schemas: HealthStatus: type: object properties: status: type: string required: - status Project: type: object properties: id: type: integer name: type: string description: type: ["string", "null"] language: type: string createdAt: type: string updatedAt: type: string required: - id - name - language - createdAt - updatedAt CreateProjectBody: type: object properties: name: type: string description: type: ["string", "null"] language: type: string template: type: ["string", "null"] description: "Optional template id to scaffold the project (blank, vite-react, express-ts, flask-python, static-html, nextjs)" required: - name - language UpdateProjectBody: type: object properties: name: type: string description: type: ["string", "null"] ProjectFile: type: object properties: id: type: integer projectId: type: integer name: type: string path: type: string content: type: string language: type: ["string", "null"] createdAt: type: string updatedAt: type: string required: - id - projectId - name - path - content - createdAt - updatedAt CreateFileBody: type: object properties: name: type: string path: type: string content: type: string language: type: ["string", "null"] required: - name - path - content UpdateFileBody: type: object properties: content: type: string name: type: string path: type: string required: - content AiChatBody: type: object properties: projectId: type: integer message: type: string history: type: array items: $ref: "#/components/schemas/ChatMessage" fileContext: type: ["string", "null"] description: Current file content for context fileName: type: ["string", "null"] description: Current file name for context required: - message ChatMessage: type: object properties: role: type: string enum: [user, assistant] content: type: string required: - role - content AdminSettings: type: object properties: apiKeyConfigured: type: boolean model: type: string updatedAt: type: ["string", "null"] required: - apiKeyConfigured - model UpdateAdminSettingsBody: type: object properties: geminiApiKey: type: string model: type: string required: [] AdminStats: type: object properties: projectCount: type: integer fileCount: type: integer totalRequests: type: integer required: - projectCount - fileCount - totalRequests Conversation: type: object properties: id: type: integer projectId: type: integer title: type: string createdAt: type: string updatedAt: type: string required: - id - projectId - title - createdAt - updatedAt CreateConversationBody: type: object properties: title: type: string UpdateConversationBody: type: object properties: title: type: string required: - title ConversationMessage: type: object properties: id: type: integer conversationId: type: integer role: type: string enum: [user, assistant] content: type: string createdAt: type: string required: - id - conversationId - role - content - createdAt CreateMessageBody: type: object properties: role: type: string enum: [user, assistant] content: type: string required: - role - content