Error Reference

Every API error returns a consistent structure with actionable guidance.

Error format
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "You've hit your daily request limit of 500 requests.",
    "suggestion": "Upgrade to Pro for 10,000 daily requests, or wait until 12:00 AM IST for your limit to reset.",
    "docs_url": "https://nascentist.ai/docs/errors#rate_limit_exceeded",
    "request_id": "nsc_req_abc123",
    "retry_after": 43200
  }
}

Error Codes

authentication_failed401

Invalid API Key

The API key is missing, malformed, revoked, or does not exist.

Fix: Generate a new key from /dashboard/api-keys and ensure it starts with nsc_live_. Keep it secret—never commit to git.

insufficient_scope403

Missing Permission

The API key does not have permission for this endpoint.

Fix: Create a new key with the required scopes, or use a key that includes access to all endpoints.

invalid_request400

Malformed Request

Missing required field or invalid parameter value.

Fix: Check request body against the API reference. Ensure JSON is valid and all required fields are present.

missing_code400

Code Required

The request body missing a "code" field.

Fix: Include a "code" property with your code snippet.

missing_prompt400

Prompt Required

The request body missing a "prompt" field.

Fix: Include a "prompt" property with your coding prompt.

rate_limit_exceeded429

Rate Limit Exceeded

Too many requests in the current window (RPM/RPD/TPM).

Fix: Implement exponential backoff. Consider upgrading your plan for higher limits. Bonus: Refer friends for +500 RPD.

daily_limit_exceeded429

Daily Quota Reached

Plan's daily request limit has been consumed.

Fix: Wait for reset at midnight IST or upgrade to a higher plan for more daily requests.

inference_error500

Model Inference Failed

The inference server encountered an error while processing.

Fix: Retry with exponential backoff. Check status.nascentist.ai for service health.

context_too_long400

Context Length Exceeded

Combined prompt + memory + system exceeds model context window.

Fix: Reduce code size, clear some memories, or break your request into smaller parts.

sandbox_timeout408

Execution Timeout

Code execution took longer than 5 seconds in the sandbox.

Fix: Review for infinite loops or performance issues. Simplify the code.

memory_limit_exceeded400

Too Many Memories

Maximum of 50 memories per user has been reached.

Fix: Delete unused memories from /dashboard/memory before adding new ones.

overloaded503

Service Overloaded

Inference servers are temporarily at capacity.

Fix: Retry after the number of seconds specified in retry_after. We're scaling automatically.

invalid_framework400

Invalid Test Framework

Specified framework is not supported for the language.

Fix: Omit framework to auto-detect, or choose from the supported list in the docs.

invalid_level400

Invalid Explanation Level

Level must be beginner, intermediate, or expert.

Fix: Use one of the allowed values: beginner, intermediate, expert.

invalid_focus400

Invalid Focus Mode

Focus must be bug, code, or both.

Fix: Use one of the allowed values: bug, code, both.

extraction_failed500

Memory Extraction Failed

The code analysis service encountered an error.

Fix: Try again with a simpler code snippet or contact support.

Common Error Patterns

Rate limiting

3 lines
curl -X POST https://api.nascentist.ai/v1/complete \
  -H "Authorization: Bearer nsc_live_YOUR_KEY" \
  -d '{"prompt": "def hello()"}'

You'll receive a 429 with retry info. Implement exponential backoff:

11 lines
import time
import requests

retry = 0
while retry < 3:
    resp = requests.post(...)
    if resp.status_code != 429:
        break
    retry_after = resp.json()["error"]["retry_after"]
    time.sleep(retry_after)
    retry += 1

Authentication errors

Always send Authorization header from server-side. Never expose keys in client-side code.

8 lines
// Server-side only
const response = await fetch("https://api.nascentist.ai/v1/complete", {
  headers: {
    "Authorization": "Bearer nsc_live_YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ prompt: "..." })
});
Need help?
Include your request ID in support tickets for faster resolution. Find it in the X-Request-Id header of any error response.