Skip to main content

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.

Secure

Enterprise Integrations

OAuth flows, data sync, and webhooks for GitHub, Supabase, Stripe.

Scalable

Utilities & Publishing

Edge-optimized tools for deployment, search, and monitoring.

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:
Response: text/event-stream
Notes:
  • 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:
Response: SSE with reasoning traces.

GET /ws/agent – WebSocket Agent Control

Persistent connection for real-time agent management. Upgrade Headers:
Messages:
  • Client → Server: {"type": "agent_command", "command": "debug", "params": {...}}
  • Server → Client: {"type": "progress", "status": "running", "eta": "2s"}
Notes: Handles up to 10k concurrent connections via Durable Objects. Ping/pong every 30s.

Integrations APIs

POST /api/integrations/:provider/auth – OAuth Initiation

Start secure integration flow (GitHub, Supabase, etc.). Path Params: provider (e.g., “github”) Request:
Response:
Error Handling: 401 if scopes invalid; retries with exponential backoff.

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:
Response: SSE stream of import progress (cloning, parsing, AI summary).

Payments & Billing

POST /api/stripe/create-checkout – Session Creation

Generate secure checkout for plans. Request:
Response:
Webhook: POST /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:
Response:

POST /api/publish-github-pages – Instant Deployment

Deploy generated site to GitHub Pages. Request:
Response: SSE with deploy progress; returns live URL on completion.

POST /api/search – Internal Codebase Search

Semantic search across imported repos. Rate Limits: 200/min; enterprise tiers allow unlimited.

Error Codes & Best Practices

Best Practices:
  • 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.
This API suite scales to 1M+ users with Cloudflare’s edge network. For custom endpoints, contact enterprise@chromaflow.ai.