Real-Time Enterprise API Reference
ChromaFlow’s APIs power real-time AI development at enterprise scale. All endpoints use JSON payloads, Bearer token auth (via Auth0), and follow REST conventions with SSE/WebSocket for streaming. Base URL:https://app.chromaflow.ai
.
Streaming
Real-Time Chat
Low-latency AI interactions with progressive responses and agent orchestration.
Authentication & Headers
All requests require:- Token Acquisition: Use
/auth/login
or Auth0 SDK. - Scopes:
chat:write
,integrations:read
,billing:manage
(RBAC enforced). - Rate Limits: 100 req/min (chat), 50 req/min (integrations); burst to 500. Exceeding returns 429 with
Retry-After
. - Error Format:
Real-Time Chat & Agents
POST /api/chat
– Streaming Conversation
Initiate real-time chat with Claude models. Supports tool-calling and search augmentation.
Auth: chat:write
Request:
text/event-stream
- Auto-triggers Perplexity if confidence < 0.8.
- Special commands:
!search
,!image
, parsed server-side. - Scalability: Edge-cached prompts; Durable Objects for session state.
POST /api/enhanced-chat
– Advanced Orchestration
Enhanced with step-by-step reasoning and auto-debug.
Request:
GET /ws/agent
– WebSocket Agent Control
Persistent connection for real-time agent management.
Upgrade Headers:
- Client → Server:
{"type": "agent_command", "command": "debug", "params": {...}}
- Server → Client:
{"type": "progress", "status": "running", "eta": "2s"}
Integrations APIs
POST /api/integrations/:provider/auth
– OAuth Initiation
Start secure integration flow (GitHub, Supabase, etc.).
Path Params: provider
(e.g., “github”)
Request:
GET /api/integrations/:provider/status
– Connection Check
Verify integration status and metadata.
Response:
POST /api/github/import
– Repo Import
Real-time repository cloning and analysis.
Request:
Provider | Supported Scopes | Sync Frequency | Enterprise Features |
---|---|---|---|
GitHub | repo, user, workflow | Real-time webhooks | Branch protection, CI integration |
Supabase | project:manage | On-demand | RLS policies, edge functions |
Stripe | billing:read_write | Event-driven | Subscription metering, invoices |
Payments & Billing
POST /api/stripe/create-checkout
– Session Creation
Generate secure checkout for plans.
Request:
/api/stripe/webhook
– Verify with STRIPE_WEBHOOK_SECRET
; handles subscription events.
GET /api/stripe/billing-portal
– Customer Portal
Redirect to Stripe portal for management.
Security: SCA compliant; audit logs in Supabase.
Utilities & Publishing
POST /api/perplexity-search
– Intelligent Search
Enterprise-grade web search with caching.
Request:
POST /api/publish-github-pages
– Instant Deployment
Deploy generated site to GitHub Pages.
Request:
POST /api/search
– Internal Codebase Search
Semantic search across imported repos.
Rate Limits: 200/min; enterprise tiers allow unlimited.
Error Codes & Best Practices
Code | Description | Resolution |
---|---|---|
429 | Rate Limited | Implement exponential backoff; upgrade plan |
401 | Unauthorized | Refresh token; check scopes |
503 | Service Unavailable | Retry with jitter; check status.chromaflow.ai |
- Use connection pooling for high-volume integrations.
- Monitor via
/api/usage
endpoint (enterprise only). - Implement client-side caching for search results (TTL: 5min).
- For real-time: Handle SSE reconnections gracefully; use WebSocket heartbeats.