{"record":{"id":"045c3520ca6340d2","repo":"BerriAI/litellm","slug":"raw-response-text-045c35","errorCode":null,"errorMessage":"{raw_response.text}","messagePattern":"\\{raw_response\\.text\\}","errorType":"http","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/llms/jina_ai/rerank/transformation.py","lineNumber":98,"sourceCode":"        optional_rerank_params: dict,\n        headers: dict,\n        litellm_params: dict | None = None,\n    ) -> dict:\n        return {\"model\": model, **optional_rerank_params}\n\n    def transform_rerank_response(\n        self,\n        model: str,\n        raw_response: Response,\n        model_response: RerankResponse,\n        logging_obj: LiteLLMLoggingObj,\n        api_key: str | None = None,\n        request_data: dict = {},\n        optional_params: dict = {},\n        litellm_params: dict = {},\n    ) -> RerankResponse:\n        if raw_response.status_code != 200:\n            raise Exception(raw_response.text)\n\n        logging_obj.post_call(original_response=raw_response.text)\n\n        _json_response: Final = raw_response.json()\n\n        _billed_units: Final = RerankBilledUnits(**_json_response.get(\"usage\", {}))\n        _tokens: Final = RerankTokens(**_json_response.get(\"usage\", {}))\n        rerank_meta: Final = RerankResponseMeta(billed_units=_billed_units, tokens=_tokens)\n\n        _results: Final[list[dict] | None] = _json_response.get(\"results\")\n\n        if _results is None:\n            raise ValueError(f\"No results found in the response={_json_response}\")\n\n        # Transform Jina AI's response format to match LiteLLM's expected format\n        # Jina AI returns: {\"index\": 0, \"relevance_score\": 0.72, \"document\": \"hello\"}\n        # LiteLLM expects: {\"index\": 0, \"relevance_score\": 0.72, \"document\": {\"text\": \"hello\"}}\n        transformed_results: Final = []","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/jina_ai/rerank/transformation.py#L80-L116","documentation":"Raised by the Jina AI rerank transformation when the HTTP status is not 200; the raw response body is re-raised as a plain Exception. Jina's API returns structured error bodies (invalid key, quota exceeded, bad request) whose text is surfaced verbatim.","triggerScenarios":"litellm.rerank(model='jina_ai/jina-reranker-v2-base-multilingual', ...) with an invalid/expired key (401), exhausted free credits (429/402), malformed request (400), or a non-existent model id (404).","commonSituations":"Hardcoded or rotated Jina API keys expiring; free-tier credit exhaustion in CI; passing Cohere-style params Jina rejects.","solutions":["Read the exception message — it is Jina's own error payload naming the cause.","Set a fresh key: api_key=... or the JINA_API_KEY environment variable.","Check plan/quotas at jina.ai if the message mentions billing or rate limits.","Confirm the model name exists under your account's accessible models."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ranked = litellm.rerank(model='jina_ai/jina-reranker-v2-base-multilingual', query=q, documents=docs)\nexcept Exception as e:\n    msg = str(e).lower()\n    if 'unauthorized' in msg or 'api key' in msg:\n        raise AuthError('Jina key invalid') from e\n    if 'rate' in msg or 'quota' in msg or 'billing' in msg:\n        raise QuotaError('Jina quota exhausted') from e\n    raise","preventionTips":["Monitor Jina usage/credits before they hit zero","Wrap provider calls in classified exception translation so auth vs quota vs bug paths differ"],"tags":["jina-ai","rerank","upstream-error","auth","quota"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}