{"record":{"id":"415b42178cdccd01","repo":"BerriAI/litellm","slug":"api-base-is-required-415b42","errorCode":null,"errorMessage":"api_base is required","messagePattern":"api_base is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/skills/transformation.py","lineNumber":73,"sourceCode":"    def get_complete_url(\n        self,\n        api_base: str | None,\n        endpoint: str,\n        skill_id: str | None = None,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for the API request\n\n        Args:\n            api_base: Base API URL\n            endpoint: API endpoint (e.g., 'skills', 'skills/{id}')\n            skill_id: Optional skill ID for specific skill operations\n\n        Returns:\n            Complete URL\n        \"\"\"\n        if api_base is None:\n            raise ValueError(\"api_base is required\")\n        return f\"{api_base}/v1/{endpoint}\"\n\n    @abstractmethod\n    def transform_create_skill_request(\n        self,\n        create_request: CreateSkillRequest,\n        litellm_params: GenericLiteLLMParams,\n        headers: dict,\n    ) -> dict:\n        \"\"\"\n        Transform create skill request to provider-specific format\n\n        Args:\n            create_request: Skill creation parameters\n            litellm_params: LiteLLM parameters\n            headers: Request headers\n\n        Returns:","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/base_llm/skills/transformation.py#L55-L91","documentation":"In the skills (agent-skills) base transformation, get_complete_url(api_base, endpoint, skill_id) builds '{api_base}/v1/{endpoint}'. If api_base is None it raises ValueError('api_base is required') before any string formatting would produce 'None/v1/skills'. The api_base normally comes from litellm_params.api_base, the provider's default, or an env var; none was found.","triggerScenarios":"Calling the litellm skills CRUD API (create/list/get skill) for a provider without a resolvable api_base — no api_base passed, no provider default configured, and the relevant *_API_BASE env var unset.","commonSituations":"Using a custom/self-hosted skills gateway but forgetting to set api_base; env var name mismatch after provider rename; running in CI/deployment where the env var that exists locally was never set.","solutions":["Pass api_base explicitly in the skills call / litellm_params (e.g. api_base=\"https://my-gateway.example\").","Set the provider's base env var (e.g. export MYPROVIDER_API_BASE=...) so the config can resolve it.","Add a startup assertion/validation that required skills-provider config (api_base + api_key) is present before serving traffic."],"exampleFix":"# before\nlitellm.acreate_skill(provider=\"myprov\", create_request=req)  # ValueError: api_base is required\n\n# after\nlitellm.acreate_skill(\n    provider=\"myprov\",\n    create_request=req,\n    litellm_params={\"api_base\": \"https://skills.internal.example\"},\n)","handlingStrategy":"validation","validationCode":"api_base = litellm_params.get(\"api_base\") or os.getenv(\"MYPROV_API_BASE\")\nif not api_base:\n    raise ValueError(\"skills provider requires api_base (param or MYPROV_API_BASE)\")","typeGuard":null,"tryCatchPattern":"try:\n    await litellm.acreate_skill(provider=\"myprov\", create_request=req, litellm_params=params)\nexcept ValueError as e:\n    if \"api_base is required\" in str(e):\n        params.setdefault(\"api_base\", os.environ[\"MYPROV_API_BASE\"])\n        await litellm.acreate_skill(provider=\"myprov\", create_request=req, litellm_params=params)\n    else:\n        raise","preventionTips":["Validate required provider config (api_base, api_key) at app startup, not per call.","Keep provider env vars in a checklist when deploying to new environments."],"tags":["skills","configuration","api-base","value-error","litellm"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}