Error Handling¶
All API errors return a JSON response body with a detail field describing the problem.
Error Response Format¶
HTTP Status Codes¶
| Status Code | Meaning | Typical Cause |
|---|---|---|
200 OK |
Success | Request processed and response returned |
422 Unprocessable Entity |
Validation Error | Missing or wrong-type request fields |
500 Internal Server Error |
Server Error | LLM call failed, SQL error, or service misconfiguration |
Common Errors¶
422 — Validation Error¶
Returned when a required field is missing or has the wrong type.
{
"detail": [
{
"type": "missing",
"loc": ["body", "question"],
"msg": "Field required",
"input": {},
"url": "https://errors.pydantic.dev/2.11/v/missing"
}
]
}
500 — OpenAI Quota Exceeded¶
If the OpenAI API rate limit is hit:
Resolution
Check your OpenAI billing dashboard and ensure your API key has an active quota. Consider implementing exponential backoff retries for production.
500 — SQL Execution Error¶
If Vanna generates syntactically invalid SQL:
Resolution
Add more training examples to ChromaDB that demonstrate the correct column names. Re-running vn.train(ddl=...) and vn.train(question=..., sql=...) improves accuracy.