{"record":{"id":"a5e4b7d38ed38d44","repo":"BerriAI/litellm","slug":"invalid-token-response-data","errorCode":null,"errorMessage":"Invalid token response: {data}","messagePattern":"Invalid token response: (.+?)","errorType":"exception","errorClass":"GigaChatAuthError","httpStatus":500,"severity":"error","filePath":"litellm/llms/gigachat/authenticator.py","lineNumber":229,"sourceCode":"            message=f\"GigaChat authentication failed: {e.response.text}\",\n        )\n    except httpx.RequestError as e:\n        raise GigaChatAuthError(\n            status_code=500,\n            message=f\"GigaChat authentication request failed: {e}\",\n        )\n\n\ndef _parse_token_response(response: httpx.Response) -> tuple[str, int]:\n    \"\"\"Parse OAuth token response.\"\"\"\n    data: Final = response.json()\n\n    # GigaChat returns either 'tok'/'exp' or 'access_token'/'expires_at'\n    access_token: Final = data.get(\"tok\") or data.get(\"access_token\")\n    expires_at = data.get(\"exp\") or data.get(\"expires_at\")\n\n    if not access_token:\n        raise GigaChatAuthError(\n            status_code=500,\n            message=f\"Invalid token response: {data}\",\n        )\n\n    # expires_at is in milliseconds\n    if isinstance(expires_at, str):\n        expires_at = int(expires_at)\n\n    verbose_logger.debug(\"GigaChat access token obtained successfully\")\n    return access_token, expires_at\n","sourceCodeStart":211,"sourceCodeEnd":240,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/gigachat/authenticator.py#L211-L240","documentation":"Error \"Invalid token response: {data}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/gigachat/authenticator.py:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The token endpoint returned an unexpected payload; verify the credentials and auth scope, and check the logged data for the provider's error field."],"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"}