POST /v1/agent/review
Review code for readability, quality, and potential issues. Get detailed feedback with suggestions for improvement.
Endpoint
POST https://api.nascentist.ai/v1/agent/reviewParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| code | string | Yes | — | Full code to review |
| language | string | No | "python" | python/javascript/typescript/go/rust |
| focus_areas | string[] | No | null | Array: "security", "performance", "readability", "best_practices" |
Example request
curl -X POST https://api.nascentist.ai/v1/agent/review \
-H "Authorization: Bearer nsc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "def process_data(data):\n results = []\n for item in data:\n results.append(item * 2)\n return results",
"language": "python"
}'Response
{
"model": "nascentist-1",
"summary": "The code is functional but could benefit from better practices. Consider using list comprehensions and adding type hints.",
"issues": [
{
"severity": "warning",
"line": 2,
"message": "Consider using list comprehension instead of append in loop",
"suggestion": "results = [item * 2 for item in data]"
},
{
"severity": "info",
"line": 1,
"message": "Function lacks type hints",
"suggestion": "def process_data(data: list) -> list:"
}
],
"suggestions": [
"Add docstring to document function purpose",
"Consider using typing.List for better type safety",
"Add error handling for non-numeric items"
],
"security_flags": [],
"quality_score": 72,
"usage": {
"total_tokens": 342
},
"latency_ms": 1250
}Response fields
- summary — Brief overview of the code quality
- issues — Array of issues found with line numbers and suggestions
- suggestions — General improvement recommendations
- security_flags — Potential security vulnerabilities
- quality_score — Overall quality score (0-100)
Issue severity levels
- error — Critical issue that will cause problems
- warning — Should be addressed for best practices
- info — Suggestions for improvement