Go to production
Authentication
All requests require Authorization: Bearer <api_key>. API keys are created per-tenant in the dashboard.
curl https://app.neureus.ai/ai/chat \ -H "Authorization: Bearer nru_your_key" \ -H "Content-Type: application/json" \ -d '{"messages": [...], "model": "meta-llm"}'API key types:
nru_— standard API key, full access to all featurespk_— publishable widget key, client-side safe, chat-only
Error responses
All errors return JSON with error and message fields:
{ "error": "UNAUTHORIZED", "message": "Invalid or missing API key" }| HTTP status | Meaning | What to do |
|---|---|---|
400 | Bad request | Check request body schema |
401 | Unauthorized | Check API key is valid and included |
402 | Payment required | Billing limit reached — upgrade plan |
403 | Forbidden | Insufficient RBAC role for this operation |
422 | Validation error | PHI/PII detected in regulated composite profile |
429 | Rate limited | Back off and retry with exponential delay |
500 | Internal error | Retry once; if persistent, check /health |
Rate limits
Rate limits are enforced per-tenant via a Durable Object rate limiter. When you receive 429, the response includes Retry-After: <seconds>.
async function chatWithRetry(client: Neureus, payload: any, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { return await client.ai.chat(payload); } catch (err: any) { if (err.status !== 429 || i === maxRetries - 1) throw err; const retryAfter = parseInt(err.headers?.['retry-after'] ?? '2'); await new Promise(r => setTimeout(r, retryAfter * 1000 * Math.pow(2, i))); } }}Health check
curl https://app.neureus.ai/health# → {"status":"ok","product":"neureus"}Use this endpoint for uptime monitoring and load balancer health checks.
Monitoring
The /monitoring/* endpoints expose health alerts, metrics, and a status page. Operational metrics (request latency, LLM token counts, auth events) are captured automatically via Cloudflare Analytics Engine.
RBAC roles
Team members have one of four roles: owner > admin > developer > viewer. Sensitive operations (billing, team management, BYOK keys) require admin or owner.
Set roles via Settings → Team in the dashboard.