📚 API Documentation
Integrate Vibe Coding AI into your applications.
Authentication
All API requests require authentication using Laravel Sanctum tokens. Include your token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN
Endpoints
Base URL: https://new.denvermobileappdeveloper.com/api/vibe-coding
POST /chat
Chat with AI (streaming response).
Request Body
{
"message": "string (required)",
"conversation": "array (optional)",
"context_files": "array (optional)",
"model": "string (optional)"
}
Response (Server-Sent Events)
data: {"type": "content", "content": "chunk"}
data: {"type": "done", "input_tokens": 100, "output_tokens": 200}
POST /generate
Generate code from a description.
Request Body
{
"prompt": "string (required)",
"language": "string (optional)",
"context_files": "array (optional)"
}
Response
{
"success": true,
"code": "generated code...",
"tokens_used": 500,
"cost": 0.015
}
POST /refactor
Refactor code based on instructions.
Request Body
{
"code": "string (required)",
"instructions": "string (required)",
"language": "string (optional)"
}
POST /debug
Debug code and get fix suggestions.
Request Body
{
"code": "string (required)",
"error": "string (required)",
"language": "string (optional)"
}
POST /explain
Get code explanations at different verbosity levels.
Request Body
{
"code": "string (required)",
"language": "string (optional)",
"verbosity": "brief|detailed|expert (optional, default: detailed)"
}
Credits
Check your credit balance with:
GET /balance
{
"balance": 1500,
"stats": {
"current_balance": 1500,
"total_purchased": 2000,
"total_used": 500,
"total_spent": 20.00
}
}
Error Codes
| Code | Description |
|---|---|
401 |
Unauthorized - Invalid or missing API token |
402 |
Insufficient credits |
422 |
Validation error - Check request body |
429 |
Rate limit exceeded |
500 |
Server error - AI provider unavailable |