API Overview

The Autoflowly API provides programmatic access to MVP generation, diagnostics, and deployment.

Base URL

https://api.autoflowly.com/api

All API requests must be made over HTTPS.

Authentication

Include your JWT token in the request header:

curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \ https://api.autoflowly.com/api/conversational-mvp/quick-mvp

Core Endpoints

MVP Generation

MethodEndpointDescription
POST/conversational-mvp/quick-mvpGenerate a full-stack MVP from a description
POST/conversational-mvp/chatConversational MVP generation with follow-ups
GET/conversational-mvp/session/{id}Get session state and generated files

Editor & SmartDoctor

MethodEndpointDescription
POST/conversational-mvp/editor/doctor/diagnoseDiagnose issues in an MVP
POST/conversational-mvp/editor/doctor/fixAuto-fix all detected issues
POST/conversational-mvp/editor/saveSave file changes
POST/conversational-mvp/editor/redeployRedeploy MVP with changes

AI Agents

MethodEndpointDescription
POST/agents/cto/chatChat with the CTO agent
POST/agents/cmo/chatChat with the CMO agent
POST/agents/cfo/chatChat with the CFO agent

Quick Start Example

Generate an MVP with a single API call:

const response = await fetch('https://api.autoflowly.com/api/conversational-mvp/quick-mvp', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ app_name: "Budget Tracker", description: "Personal budget tracker for freelancers with expense categories, income tracking, and monthly reports", ai_provider: "claude" }) }) const data = await response.json() console.log(data.preview_url) // https://mvp-budget-tracker.preview.autoflowly.com console.log(data.mvp_files) // { "frontend/src/app/page.tsx": "...", ... }

Diagnose and Fix

Run SmartDoctor diagnostics on a generated MVP:

// Step 1: Diagnose const diagnosis = await fetch('https://api.autoflowly.com/api/conversational-mvp/editor/doctor/diagnose', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ session_id: "your-session-id", mvp_id: "your-mvp-id" }) }) const report = await diagnosis.json() // report.health_score: 85 // report.issues: [{ severity: "warning", title: "Missing dependency", ... }] // Step 2: Fix all issues const fix = await fetch('https://api.autoflowly.com/api/conversational-mvp/editor/doctor/fix', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ session_id: "your-session-id", mvp_id: "your-mvp-id", auto_redeploy: true, create_snapshot: true }) })

AI Provider Selection

The ai_provider parameter controls which AI model generates code:

ValueProviderModel
"claude" (default)Anthropicclaude-3-5-sonnet
"chatgpt"OpenAIgpt-4 / gpt-3.5-turbo
"gemini"Googlegemini-pro
"auto"Best availableAutomatic selection with fallback

If your selected provider is unavailable, the system automatically falls back to another provider when AI_FALLBACK_ENABLED=true.

Rate Limits

EndpointLimit
MVP Generation10 per hour
Diagnose/Fix30 per hour
Agent Chat60 per hour

Error Responses

All errors follow a consistent format:

{ "detail": "Description of the error", "status_code": 400 }
CodeMeaning
400Invalid request parameters
401Missing or invalid authentication
404Resource not found
429Rate limit exceeded
500Internal server error