API: Errors, Status Codes & Limits
Complete reference of HTTP status codes, the OpenAI-compatible error shape, and the budget and size limits of the public Kasimir API.
The Kasimir API is OpenAI-compatible: errors are returned in the same JSON format as OpenAI’s, so common OpenAI SDKs report them as usual. This page describes the status codes, the error object and the limits that apply to requests.
Error format
{
"error": {
"message": "Model \"foo\" not found",
"type": "not_found_error",
"code": null
}
}Field | Content |
|---|---|
message | Readable description of the error |
type | Error kind, derived from the status code (see below) |
code | Currently always null |
Streaming: if an error occurs after the stream has started, the stream ends. Treat an unexpectedly ending stream as an error in your client.
Status codes
Status | type | Meaning | What to do |
|---|---|---|---|
400 | invalid_request_error | Invalid request, e.g. model, messages or input missing. | Fix the request; retrying will not help. |
401 | authentication_error | Key missing, invalid or revoked. | Check the key or create a new one. |
402 | insufficient_quota | Your company’s monthly budget is used up. | Raise the budget under Administration → Usage & Billing or wait for the new month. |
403 | permission_error | The key lacks a required scope, the model is disabled or not enabled for your company (e.g. a non-EU model or a model your plan does not include), or your company is suspended. | Ask an owner or admin about the scope or model approval. |
404 | not_found_error | Model or agent not found or not available for your company. | Compare the model slug with GET /v1/models; check the agent ID. |
429 | invalid_request_error | Too many requests in a short time with this key, or the model is busy right now. | Wait briefly and retry with backoff. |
5xx | api_error | Temporary processing error. | Retry with backoff. 503 means the budget could not be checked right now – resend shortly afterwards. |
402 does not mean “this request is too expensive” but “the company’s monthly budget has been reached”. It counts all AI usage of your company in the current calendar month – via the API and in the app.
Limits
Limit | Value | Applies to |
|---|---|---|
Monthly budget | as set under Administration → Usage & Billing; unlimited without a budget | all endpoints |
messages | at least 1 message | /v1/chat/completions |
n | 1 to 8 | /v1/chat/completions |
messages | 1 to 50 messages | /v1/assistants/{id}/run |
temperature | 0 to 2 | /v1/assistants/{id}/run |
max_tokens | 1 to 32,000 | /v1/assistants/{id}/run |
/v1/chat/completions passes the parameters of the OpenAI chat API (e.g. temperature, max_tokens, tools or response_format) on to the model; the API ignores any other fields. If the model does not accept a value, its status code is returned, but only with a generic message instead of the model's own error message.
In SDKs
Because the error format is OpenAI-compliant, every OpenAI SDK recognises these cases: the Python SDK raises e.g. AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), RateLimitError (429) and APIStatusError (5xx). Read the specific reason from error.message.