API Reference
VibeCode API Reference
Section titled “VibeCode API Reference”Last updated: 2025-08-25T18:53:28.182Z
This comprehensive API reference provides detailed documentation for all VibeCode platform endpoints.
Overview
Section titled “Overview”The VibeCode API provides programmatic access to:
- 🤖 AI-powered code generation and analysis
- 📁 Project management and templates
- 🤝 Real-time collaboration features
- 📂 File operations and synchronization
- 📊 Monitoring and observability
- 🔒 Authentication and security
Base URLs
Section titled “Base URLs”Production: https://vibecode.example.com/apiDevelopment: http://localhost:3000/apiAuthentication
Section titled “Authentication”Most endpoints require authentication via one of these methods:
JWT Bearer Token
Section titled “JWT Bearer Token”Authorization: Bearer <your_jwt_token>API Key
Section titled “API Key”x-api-key: <your_api_key>Rate Limits
Section titled “Rate Limits”| Endpoint Type | Requests per Minute |
|---|---|
| Standard endpoints | 100 |
| AI endpoints | 20 |
| File upload endpoints | 10 |
API Categories
Section titled “API Categories”🤖 AI Services
Section titled “🤖 AI Services”/api/ai/chat- AI chat completions/api/ai/generate-project- Generate projects from prompts/api/ai/search- Vector search for RAG/api/claude/chat- Claude-specific chat endpoint
🔒 Authentication
Section titled “🔒 Authentication”/api/auth/[...nextauth]- NextAuth.js endpoints/api/auth/mfa/setup- Multi-factor authentication setup/api/auth/saml/sso- SAML SSO integration
📂 File Management
Section titled “📂 File Management”/api/files- File CRUD operations/api/files/sync- Real-time file synchronization
📊 Monitoring
Section titled “📊 Monitoring”/api/monitoring/dashboard- Monitoring dashboard data/api/monitoring/metrics- Performance metrics/api/monitoring/security- Security monitoring
🛠️ Development Tools
Section titled “🛠️ Development Tools”/api/code-server/session- Code server management/api/terminal/session- Terminal sessions/api/terminal/ws- WebSocket terminal connection
💬 Chat & Communication
Section titled “💬 Chat & Communication”/api/chat/stream- Streaming chat/api/chat/mongodb- Persistent chat storage
🎯 Project Management
Section titled “🎯 Project Management”/api/projects/template- Template-based project generation/api/templates- Template management
⚡ Health & Diagnostics
Section titled “⚡ Health & Diagnostics”/api/health- Comprehensive health check/api/health/simple- Simple health check
Common Response Format
Section titled “Common Response Format”All API responses follow this standard format:
{ "success": true, "data": { // Response data here }, "message": "Operation completed successfully", "timestamp": "2025-08-22T10:30:00Z", "requestId": "req_abc123"}Error Handling
Section titled “Error Handling”Error responses include detailed information:
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid request parameters", "details": { "field": "workspaceId", "issue": "Required field missing" } }, "timestamp": "2025-08-22T10:30:00Z", "requestId": "req_abc123"}Common Error Codes
Section titled “Common Error Codes”| Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Request parameters are invalid |
| 401 | UNAUTHORIZED | Authentication required or invalid |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | NOT_FOUND | Resource not found |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |
Code Examples
Section titled “Code Examples”cURL Example
Section titled “cURL Example”curl -X POST \ "https://api.vibecode.com/ai/chat" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "messages": [ {"role": "user", "content": "Create a React component"} ] }'JavaScript/TypeScript Example
Section titled “JavaScript/TypeScript Example”const response = await fetch('/api/ai/chat', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ messages: [ { role: 'user', content: 'Create a React component' } ] })});
const data = await response.json();console.log(data);Python Example
Section titled “Python Example”import requests
response = requests.post( 'https://api.vibecode.com/ai/chat', headers={ 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' }, json={ 'messages': [ {'role': 'user', 'content': 'Create a React component'} ] })
data = response.json()print(data)SDK Support
Section titled “SDK Support”Official SDKs
Section titled “Official SDKs”- TypeScript/JavaScript:
npm install @vibecode/api-client - Python:
pip install vibecode-api - Go:
go get github.com/vibecode/go-client
For detailed endpoint documentation, refer to the auto-generated Postman collection published in the CI artifacts.
This documentation is automatically generated and kept in sync with the codebase.