{"record":{"id":"49518b4d71eb8d52","repo":"BerriAI/litellm","slug":"api-base-is-required-for-azure-ai-studio-please-s","errorCode":null,"errorMessage":"api_base is required for Azure AI Studio. Please set the api_base parameter. Passed `api_base={api_base}`","messagePattern":"api_base is required for Azure AI Studio\\. Please set the api_base parameter\\. Passed `api_base=(.+?)`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure/common_utils.py","lineNumber":738,"sourceCode":"    def _get_base_azure_url(\n        api_base: str | None,\n        litellm_params: GenericLiteLLMParams | Mapping[str, object] | None,\n        route: Literal[\"/openai/responses\", \"/openai/vector_stores\"] | str,\n        default_api_version: str | Literal[\"latest\", \"preview\"] | None = None,\n    ) -> str:\n        \"\"\"\n        Get the base Azure URL for the given route and API version.\n\n        Args:\n            api_base: The base URL of the Azure API.\n            litellm_params: The litellm parameters.\n            route: The route to the API.\n            default_api_version: The default API version to use if no api_version is provided. If 'latest', it will use `openai/v1/...` route.\n        \"\"\"\n\n        api_base = api_base or litellm.api_base or get_secret_str(\"AZURE_API_BASE\")\n        if api_base is None:\n            raise ValueError(\n                f\"api_base is required for Azure AI Studio. Please set the api_base parameter. Passed `api_base={api_base}`\"\n            )\n        original_url: Final = httpx.URL(api_base)\n\n        # Extract api_version or use default\n        litellm_params = litellm_params or {}\n        api_version: Final = cast(str | None, litellm_params.get(\"api_version\")) or default_api_version\n\n        # Create a new dictionary with existing params\n        query_params: Final = dict(original_url.params)\n\n        # Add api_version if needed\n        if \"api-version\" not in query_params and api_version:\n            query_params[\"api-version\"] = api_version\n\n        # Add the path to the base URL\n        if route not in api_base:\n            new_url = _add_path_to_api_base(api_base=api_base, ending_path=route)","sourceCodeStart":720,"sourceCodeEnd":756,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/common_utils.py#L720-L756","documentation":"Error \"api_base is required for Azure AI Studio. Please set the api_base parameter. Passed `api_base={api_base}`\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/common_utils.py:738 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass api_base or set AZURE_API_BASE / AZURE_AI_API_BASE for Azure AI Studio."],"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"}