Skip to content

Go to production

Authentication

All requests require Authorization: Bearer <api_key>. API keys are created per-tenant in the dashboard.

Terminal window
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 features
  • pk_ — 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 statusMeaningWhat to do
400Bad requestCheck request body schema
401UnauthorizedCheck API key is valid and included
402Payment requiredBilling limit reached — upgrade plan
403ForbiddenInsufficient RBAC role for this operation
422Validation errorPHI/PII detected in regulated composite profile
429Rate limitedBack off and retry with exponential delay
500Internal errorRetry 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

Terminal window
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.