{"record":{"id":"02078fca2f87b33a","repo":"BerriAI/litellm","slug":"error-message-02078f","errorCode":null,"errorMessage":"{error.message}","messagePattern":"\\{error\\.message\\}","errorType":"http","errorClass":"DashScopeError","httpStatus":null,"severity":"error","filePath":"litellm/llms/dashscope/embed/transformation.py","lineNumber":148,"sourceCode":"        try:\n            response_json: Final = raw_response.json()\n        except Exception as e:\n            raise DashScopeError(\n                status_code=raw_response.status_code,\n                message=f\"Failed to parse DashScope response as JSON: {e}\",\n            )\n\n        logging_obj.post_call(\n            input=request_data.get(\"input\"),\n            api_key=api_key,\n            additional_args={\"complete_input_dict\": request_data},\n            original_response=response_json,\n        )\n\n        if \"error\" in response_json:\n            error: Final = response_json[\"error\"]\n            message: Final = error.get(\"message\", str(error)) if isinstance(error, dict) else str(error)\n            raise DashScopeError(\n                status_code=raw_response.status_code,\n                message=message,\n            )\n\n        model_response.object = \"list\"\n        model_response.data = response_json.get(\"data\", [])\n        model_response.model = response_json.get(\"model\", model)\n\n        usage: Final = response_json.get(\"usage\") or {}\n        prompt_tokens: Final = usage.get(\"prompt_tokens\", 0)\n        total_tokens: Final = usage.get(\"total_tokens\", prompt_tokens)\n        setattr(\n            model_response,\n            \"usage\",\n            Usage(\n                prompt_tokens=prompt_tokens,\n                completion_tokens=0,\n                total_tokens=total_tokens,","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/dashscope/embed/transformation.py#L130-L166","documentation":"The DashScope embeddings response parsed as JSON but the body contained an 'error' object — DashScope's error envelope. LiteLLM re-raises it as DashScopeError using the upstream message text (falling back to str(error) when there is no 'message' key) and the HTTP status of the response. The message you see is DashScope's own error description, so it names the real problem (invalid key, unknown model, quota, malformed input).","triggerScenarios":"Invalid/expired DASHSCOPE_API_KEY; a model name that does not exist on DashScope (typo in 'dashscope/text-embedding-vX'); exceeded account quota or QPS; malformed input such as an empty input array or non-string elements — each makes DashScope answer with an error body instead of embeddings.","commonSituations":"cn-region key used against the intl endpoint (or vice versa); free tier quota exhausted; model identifier from outdated docs; input exceeding per-request token limits.","solutions":["Read the message verbatim — it is DashScope's error text (e.g. InvalidApiKey, QuotaExceeded.AllocationQPS, Model.NotFound) and directly names the fault","Smoke-test the key with curl against the compatible-mode embeddings endpoint to confirm the failure is upstream, not LiteLLM config","Fix the specific cause: correct model name, valid key for the right region, or smaller/cleaner input","For quota/throttling errors add client-side rate limiting and retries with backoff, or raise limits in the DashScope console"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.embedding(model=model, input=texts)\nexcept Exception as e:\n    msg = str(e)\n    if 'InvalidApiKey' in msg:\n        rotate_key_and_alert()\n    elif 'quota' in msg.lower() or 'throttl' in msg.lower():\n        backoff_and_retry()\n    else:\n        raise","preventionTips":["Smoke-test the DASHSCOPE_API_KEY with a single curl call at deploy time","Monitor DashScope quota/QPS dashboards and alert before exhaustion","Pin model names to a reviewed allowlist so typos fail in tests, not production"],"tags":["dashscope","embeddings","upstream-error","api-key","quota"],"backgroundTag":"upstream-api-error","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}