{"record":{"id":"3cac9757c423e35e","repo":"BerriAI/litellm","slug":"input-parameter-is-required","errorCode":null,"errorMessage":"input parameter is required","messagePattern":"input parameter is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/openai/responses/count_tokens/transformation.py","lineNumber":60,"sourceCode":"            request[\"instructions\"] = instructions\n\n        if tools is not None:\n            request[\"tools\"] = self._transform_tools_for_responses_api(tools)\n\n        return request\n\n    def get_required_headers(self, api_key: str) -> dict[str, str]:\n        return {\n            \"Content-Type\": \"application/json\",\n            \"Authorization\": f\"Bearer {api_key}\",\n        }\n\n    def validate_request(self, model: str, input: str | list[Any]) -> None:\n        if not model:\n            raise ValueError(\"model parameter is required\")\n\n        if not input:\n            raise ValueError(\"input parameter is required\")\n\n    @staticmethod\n    def _transform_tools_for_responses_api(\n        tools: list[dict[str, Any]],\n    ) -> list[dict[str, Any]]:\n        \"\"\"\n        Transform OpenAI chat tools format to Responses API tools format.\n\n        Chat format:  {\"type\": \"function\", \"function\": {\"name\": \"...\", \"parameters\": {...}}}\n        Responses format: {\"type\": \"function\", \"name\": \"...\", \"parameters\": {...}}\n        \"\"\"\n        transformed: Final = []\n        for tool in tools:\n            if tool.get(\"type\") == \"function\" and \"function\" in tool:\n                func = tool[\"function\"]\n                item: dict[str, Any] = {\n                    \"type\": \"function\",\n                    \"name\": func.get(\"name\", \"\"),","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/openai/responses/count_tokens/transformation.py#L42-L78","documentation":"ValueError from validate_request in the count_tokens transformation: the request body omitted the 'input' field (empty/falsy), so there is no content to tokenize. It fails fast before any HTTP call is made.","triggerScenarios":"Thrown at litellm/llms/openai/responses/count_tokens/transformation.py:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the input parameter to the count_tokens call."],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}