{"record":{"id":"33faf6f4aad92f53","repo":"BerriAI/litellm","slug":"api-key-is-none-please-set-azure-ai-api-key-or-dy","errorCode":null,"errorMessage":"api_key is None. Please set AZURE_AI_API_KEY or dynamically via `api_key` param, to make the request.","messagePattern":"api_key is None\\. Please set AZURE_AI_API_KEY or dynamically via `api_key` param, to make the request\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/embed/handler.py","lineNumber":106,"sourceCode":"\n    def image_embedding(\n        self,\n        model: str,\n        data: ImageEmbeddingRequest,\n        timeout: float,\n        logging_obj,\n        model_response: EmbeddingResponse,\n        optional_params: dict,\n        api_key: str | None,\n        api_base: str | None,\n        client: HTTPHandler | AsyncHTTPHandler | None = None,\n    ):\n        if api_base is None:\n            raise ValueError(\n                \"api_base is None. Please set AZURE_AI_API_BASE or dynamically via `api_base` param, to make the request.\"\n            )\n        if api_key is None:\n            raise ValueError(\n                \"api_key is None. Please set AZURE_AI_API_KEY or dynamically via `api_key` param, to make the request.\"\n            )\n\n        if client is None or not isinstance(client, HTTPHandler):\n            client = HTTPHandler(timeout=timeout, concurrent_limit=1)\n\n        url: Final = f\"{api_base}/images/embeddings\"\n\n        response: Final = client.post(\n            url=url,\n            json=data,\n            headers={\"Authorization\": f\"Bearer {api_key}\"},\n        )\n\n        embedding_response: Final = response.json()\n        embedding_headers: Final = dict(response.headers)\n        returned_response: Final[EmbeddingResponse] = convert_to_model_response_object(\n            response_object=embedding_response,","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/embed/handler.py#L88-L124","documentation":"Error \"api_key is None. Please set AZURE_AI_API_KEY or dynamically via `api_key` param, to make the request.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/embed/handler.py:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_AI_API_KEY or pass api_key."],"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"}