context_limit
- HTTP status
- 413 Content Too Large
What happened
The input and the requested output do not fit the model: max_tokens is over the model's limit, the input with max_tokens is over its context, or, in Redact, a part of the text does not fit even after it was asked again in halves down to 1,500 characters.
What to do
Shorten the input or lower max_tokens. In Redact, split the text.
A text job can also end with this code. The job's status then carries it in the field error.
Example
JSON
{
"error": "context_limit",
"request_id": "0f8e2c4a-6b1d-4e3f-9a7c-5d2b8e1f4a60",
"doc_url": "https://developers.komplai.dk/errors/context_limit"
}Every response carries a Request-Id header, and an error body repeats it as request_id. Quote it when you ask komplai about a call.
Endpoints that can return it
- POST
/v1/redactPseudonymise a text - POST
/v1/redact/filePseudonymise the text of a PDF or Word file (beta) - POST
/v1/chat/completionsCreate a chat completion - POST
/v1/coding/chat/completionsStream a coding completion