Back to home

API Reference

RESTful API for the ProphecAI platform

Base URL
https://propechai.tech/api
Authentication

Protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <your_jwt_token>

Rate limit: 100 requests/minute per user
POST/api/auth/register

Create a new user account.

Request Body
{ "email": "string", "password": "string", "display_name": "string" }
Response
{ "token": "jwt_string", "user": { "id", "email", "display_name" } }
POST/api/auth/login

Authenticate and receive a JWT token.

Request Body
{ "email": "string", "password": "string" }
Response
{ "token": "jwt_string", "user": { "id", "email", "display_name" } }
GET/api/auth/me Auth required

Get the current authenticated user profile.

Response
{ "id", "email", "display_name", "created_at" }
POST/api/sessions Auth required

Create a new builder session.

Request Body
{ "prompt": "string", "model": "glm-4-flash" }
Response
{ "session_id", "status": "building", "created_at" }
GET/api/sessions Auth required

List all sessions for the authenticated user.

Response
[{ "session_id", "prompt", "status", "iterations", "created_at" }]
GET/api/sessions/:id Auth required

Get details of a specific session including build artifacts.

Response
{ "session_id", "prompt", "status", "html", "iterations", "token_usage", "tx_hash" }
POST/api/sessions/:id/cancel Auth required

Cancel an in-progress builder session.

Response
{ "status": "cancelled" }
GET/api/health

Health check endpoint. Returns service status.

Response
{ "status": "ok", "version": "0.2.0" }