Vichar Docs

Errors

Error JSON shape and status codes.

Errors return a JSON body:

{
	"error": {
		"message": "...",
		"type": "invalid_request_error",
		"param": null,
		"code": "invalid_api_key"
	}
}

type is one of invalid_request_error, authentication_error, rate_limit_error, gateway_error, or server_error. code gives a stable machine-readable reason when present (for example invalid_api_key, model_not_found, insufficient_quota).

StatusMeaning
400Invalid request: bad parameter, unsupported feature for the model, malformed body
401Missing, invalid, disabled, or expired API key
402Insufficient credits or a spend limit reached
403Key valid but not permitted for the resource/model
404Unknown endpoint or model
429Rate limit exceeded; honor Retry-After
500Internal error; safe to retry with backoff
502/503Upstream provider failure after failover options were exhausted

Example invalid-key response:

{
	"error": {
		"message": "Unauthorized: Invalid Vichar API token. ...",
		"type": "invalid_request_error",
		"param": null,
		"code": "invalid_api_key"
	}
}

How is this guide?