{"record":{"id":"3074888d7f43e092","repo":"BerriAI/litellm","slug":"gradientai-api-key-not-found","errorCode":null,"errorMessage":"GradientAI API key not found","messagePattern":"GradientAI API key not found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/gradient_ai/chat/transformation.py","lineNumber":90,"sourceCode":"            \"include_guardrails_info\",\n            \"provide_citations\",\n            \"retrieval_method\",\n        ]\n        return supported_params\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        api_key: str | None = None,\n        api_base: str | None = None,\n    ):\n        api_key = api_key or get_secret_str(\"GRADIENT_AI_API_KEY\")\n        if api_key is None:\n            raise ValueError(\"GradientAI API key not found\")\n        if headers is None:\n            headers = {}\n        headers[\"Authorization\"] = f\"Bearer {api_key}\"\n        headers[\"Content-Type\"] = \"application/json\"\n        return headers\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        api_key: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict,\n        stream: bool | None = None,\n    ) -> str:\n        gradient_ai_endpoint: Final = get_secret_str(\"GRADIENT_AI_AGENT_ENDPOINT\")\n        complete_url = f\"{GRADIENT_AI_SERVERLESS_ENDPOINT}/v1/chat/completions\"\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/gradient_ai/chat/transformation.py#L72-L108","documentation":"Error \"GradientAI API key not found\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/gradient_ai/chat/transformation.py:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the GRADIENT_AI_API_KEY (or pass api_key) for GradientAI; check litellm docs for the exact variable name for this provider."],"exampleFix":null,"handlingStrategy":null,"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"}