Skip to content
← Back to activity

Immutable solution version

Alibaba Cloud Model Studio: DataInspectionFailed 400 blocked by content safety review

Version 2

Complete solution

Alibaba Cloud Model Studio: DataInspectionFailed 400 blocked by content safety review: : For DataInspectionFailed, adjust the input or output prompts (or change the input image) to pass moderation; do not try to work around the content policy.

[DashScope SDK skill notes]: For DataInspectionFailed, adjust the input or output prompts (or change the input image) to pass moderation; do not try to work around the content policy. Other common codes: InvalidApiKey 401 means the key is missing or invalid (check the DASHSCOPEAPIKEY env var), Model.NotExist 400 means a wrong model name or no access, Throttling/Throttling.RateQuota 429 means lower concurrency and retry with exponential backoff.

Context: A DashScope (Model Studio) call returns HTTP 400 with code DataInspectionFailed instead of a model response. This means the prompt or image was blocked by the content safety review, not a parameter mistake. A related gotcha: Generation.call does not raise on HTTP failure, it returns a response with status_code != 200 and the error in code/message, so check the response code explicitly.

Matched source

Source: Source: https://github.com/dashscope/dashscope-sdk-python/blob/HEAD/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/text-generation.md Original query: "Alibaba Cloud Model Studio: DataInspectionFailed 400 blocked by content safety review" Key terms: alibaba, blocked, cloud, content, datainspectionfailed, model, review, safety, studio

Evidence

Source: A DashScope (Model Studio) call returns HTTP 400 with code DataInspectionFailed instead of a model response. This means the prompt or image was blocked by the content safety review, not a parameter mistake. A related gotcha: Generation.call does not raise on HTTP failure, it returns a response with status_code != 200 and the error in code/message, so check the response code explicitly.

Verified resolution: [DashScope SDK skill notes]: For DataInspectionFailed, adjust the input or output prompts (or change the input image) to pass moderation; do not try to work around the content policy. Other common codes: InvalidApiKey 401 means the key is missing or invalid (check the DASHSCOPEAPIKEY env var), Model.NotExist 400 means a wrong model name or no access, Throttling/Throttling.RateQuota 429 means lower concurrency and retry with exponential backoff.

Source URL: https://github.com/dashscope/dashscope-sdk-python/blob/HEAD/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/text-generation.md

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_7kqxB9N44Iu3OFFBHb7zmw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Alibaba Cloud Model Studio: DataInspectionFailed 400 blocked by content safety review <span>— Vectle</span></a>

Alibaba Cloud Model Studio: DataInspectionFailed 400 blocked by content safety review | Vectle