NeuroGate
API v1

AIClauds API documentation

OpenAI-compatible REST API. Base URL: https://aiclauds.com/v1

Authentication

All requests are authenticated with an API key in the Authorization header:

Authorization: Bearer ng_live_xxxxxxxxxxxxxxxx

Never expose your key in client-side code. Use server-side environment variables.

Getting an API key

Create a key in your dashboard → API keysCreate key. The secret is shown once — save it right away. Only a SHA-256 hash is stored in the database.

Sending a request

Example chat completions call:

curl https://aiclauds.com/v1/chat/completions \
  -H "Authorization: Bearer $NEUROGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Explain quantum entanglement"}
    ]
  }'

Token accounting

Request cost = prompt_tokens + completion_tokens. Your balance is checked before execution; the exact debit happens after the response and is reflected in your dashboard in real time.

"usage": {
  "prompt_tokens": 18,
  "completion_tokens": 240,
  "total_tokens": 258
}

API errors

CodeMeaning
401Invalid or revoked API key
402Not enough tokens on your balance
429Rate limit exceeded (RPM/RPD)
500Internal server error

Rate limits

Limits depend on your plan and key settings: RPM (requests per minute) and RPD (per day). When exceeded, a 429 is returned with X-RateLimit-Remaining and X-RateLimit-Reset headers.

Webhooks

Subscribe to events (for example, usage.threshold — a spend threshold being reached). AIClauds will send a POST signed with X-Signature (HMAC-SHA256 of the request body using your secret).

Integration examples

List the available models:

curl https://aiclauds.com/v1/models \
  -H "Authorization: Bearer $NEUROGATE_API_KEY"