Error Reference
Every API error returns a consistent structure with actionable guidance.
{
"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
| Code | HTTP | Title | Cause | Fix |
|---|---|---|---|---|
| authentication_failed | 401 | Invalid API Key | The API key is missing, malformed, revoked, or does not exist. | Generate a new key from /dashboard/api-keys and ensure it starts with nsc_live_. Keep it secret—never commit to git. |
| insufficient_scope | 403 | Missing Permission | The API key does not have permission for this endpoint. | Create a new key with the required scopes, or use a key that includes access to all endpoints. |
| invalid_request | 400 | Malformed Request | Missing required field or invalid parameter value. | Check request body against the API reference. Ensure JSON is valid and all required fields are present. |
| missing_code | 400 | Code Required | The request body missing a "code" field. | Include a "code" property with your code snippet. |
| missing_prompt | 400 | Prompt Required | The request body missing a "prompt" field. | Include a "prompt" property with your coding prompt. |
| rate_limit_exceeded | 429 | Rate Limit Exceeded | Too many requests in the current window (RPM/RPD/TPM). | Implement exponential backoff. Consider upgrading your plan for higher limits. Bonus: Refer friends for +500 RPD. |
| daily_limit_exceeded | 429 | Daily Quota Reached | Plan's daily request limit has been consumed. | Wait for reset at midnight IST or upgrade to a higher plan for more daily requests. |
| inference_error | 500 | Model Inference Failed | The inference server encountered an error while processing. | Retry with exponential backoff. Check status.nascentist.ai for service health. |
| context_too_long | 400 | Context Length Exceeded | Combined prompt + memory + system exceeds model context window. | Reduce code size, clear some memories, or break your request into smaller parts. |
| sandbox_timeout | 408 | Execution Timeout | Code execution took longer than 5 seconds in the sandbox. | Review for infinite loops or performance issues. Simplify the code. |
| memory_limit_exceeded | 400 | Too Many Memories | Maximum of 50 memories per user has been reached. | Delete unused memories from /dashboard/memory before adding new ones. |
| overloaded | 503 | Service Overloaded | Inference servers are temporarily at capacity. | Retry after the number of seconds specified in retry_after. We're scaling automatically. |
| invalid_framework | 400 | Invalid Test Framework | Specified framework is not supported for the language. | Omit framework to auto-detect, or choose from the supported list in the docs. |
| invalid_level | 400 | Invalid Explanation Level | Level must be beginner, intermediate, or expert. | Use one of the allowed values: beginner, intermediate, expert. |
| invalid_focus | 400 | Invalid Focus Mode | Focus must be bug, code, or both. | Use one of the allowed values: bug, code, both. |
| extraction_failed | 500 | Memory Extraction Failed | The code analysis service encountered an error. | Try again with a simpler code snippet or contact support. |
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.
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.
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.
Code Required
The request body missing a "code" field.
Fix: Include a "code" property with your code snippet.
Prompt Required
The request body missing a "prompt" field.
Fix: Include a "prompt" property with your coding prompt.
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 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.
Model Inference Failed
The inference server encountered an error while processing.
Fix: Retry with exponential backoff. Check status.nascentist.ai for service health.
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.
Execution Timeout
Code execution took longer than 5 seconds in the sandbox.
Fix: Review for infinite loops or performance issues. Simplify the code.
Too Many Memories
Maximum of 50 memories per user has been reached.
Fix: Delete unused memories from /dashboard/memory before adding new ones.
Service Overloaded
Inference servers are temporarily at capacity.
Fix: Retry after the number of seconds specified in retry_after. We're scaling automatically.
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 Explanation Level
Level must be beginner, intermediate, or expert.
Fix: Use one of the allowed values: beginner, intermediate, expert.
Invalid Focus Mode
Focus must be bug, code, or both.
Fix: Use one of the allowed values: bug, code, both.
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
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:
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 += 1Authentication errors
Always send Authorization header from server-side. Never expose keys in client-side code.
// 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: "..." })
});X-Request-Id header of any error response.