{"record":{"id":"1e1d53e6ced3b959","repo":"BerriAI/litellm","slug":"error-getting-prompt-from-humanloop-e-response-t","errorCode":null,"errorMessage":"Error getting prompt from Humanloop: {e.response.text}","messagePattern":"Error getting prompt from Humanloop: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/humanloop.py","lineNumber":79,"sourceCode":"        return compiled_prompts\n\n    def _get_prompt_from_id_api(self, humanloop_prompt_id: str, humanloop_api_key: str) -> PromptManagementClient:\n        client: Final = _get_httpx_client()\n\n        base_url: Final = f\"https://api.humanloop.com/v5/prompts/{humanloop_prompt_id}\"\n\n        response: Final = client.get(\n            url=base_url,\n            headers={\n                \"X-Api-Key\": humanloop_api_key,\n                \"Content-Type\": \"application/json\",\n            },\n        )\n\n        try:\n            response.raise_for_status()\n        except httpx.HTTPStatusError as e:\n            raise Exception(f\"Error getting prompt from Humanloop: {e.response.text}\")\n\n        json_response: Final = response.json()\n        template_message: Final = json_response[\"template\"]\n        if isinstance(template_message, dict):\n            template_messages = [template_message]\n        elif isinstance(template_message, list):\n            template_messages = template_message\n        else:\n            raise ValueError(f\"Invalid template message type: {type(template_message)}\")\n        template_model: Final = json_response[\"model\"]\n        optional_params: Final = {}\n        for k, v in json_response.items():\n            if k in litellm.OPENAI_CHAT_COMPLETION_PARAMS:\n                optional_params[k] = v\n        return PromptManagementClient(\n            prompt_id=humanloop_prompt_id,\n            prompt_template=cast(list[AllMessageValues], template_messages),\n            model=template_model,","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/humanloop.py#L61-L97","documentation":"The Humanloop prompt-fetch request returned a non-2xx status; raise_for_status fired and the handler re-raises with the API's response body so the caller sees Humanloop's own error detail (auth, unknown prompt id, etc.).","triggerScenarios":"Fetching a prompt from Humanloop returns a non-2xx API response.","commonSituations":"Invalid API key, deleted prompt, or Humanloop service outage.","solutions":["Check the Humanloop API error text in the message for the specific cause.","Verify HUMANLOOP_API_KEY is valid and the prompt exists in the Humanloop project."],"exampleFix":"os.environ['HUMANLOOP_API_KEY'] = '...'; prompt = humanloop_prompt_manager.get_prompt('my_prompt')","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}