Endpoint
Request Format
| Field | Type | Required | Description |
|---|---|---|---|
idea | string | Yes | User’s project idea (non-empty). |
sessionId | string | No | Existing workflow session; if omitted, a new UUID is generated. |
Example
Response Format
Success (200)
| Field | Type | Description |
|---|---|---|
status | "success" | |
sessionId | string | ID to use for subsequent intent, platform, payment, execute. |
stage | "idea_input" | |
analysis | object | summary, key_features[], complexity, estimated_agents. |
clarifying_questions | string[] | 3–5 questions. |
next_stage | "intent_analysis" |
Example
Error (4xx / 5xx)
| Field | Description |
|---|---|
status | "error" |
sessionId | "" when no session. |
stage | "idea_input" |
error | Message. |
Error Codes
| HTTP | Cause |
|---|---|
| 400 | idea missing, not a string, or empty after trim. |
| 405 | Method not POST. |
| 500 | processIdea (OpenRouter) or DB/write failure. |
Implementation Notes
- Uses
processIdea(idea, sessionId)fromlib/openai.ts(IdeaProcessor / OpenRouter). - Creates or updates
WorkflowviacreateWorkflowContextDB/updateWorkflowContextDB; falls back to in-memory inlib/x402on DB errors. - Persists:
idea,analysis,clarifyingQuestions,currentStage: 'idea_input'.