":{"message":"Prompt is sensitive.\n\n充满科技感的海报,大字写着 DMXAPI\n\nsdk_http_response=...
🚨 错误信息
gemini image 接口调用错误{"error":{"message":"Prompt is sensitive.\n\n充满科技感的海报,大字写着 DMXAPI\n\nsdk_http_response=HttpResponse(\n headers=\u003cdict len=13\u003e\n) candidates=[Candidate(\n content=Content(\n parts=[\n Part(\n text=\"\"\"明白了,这是一张充满科技感的海报,上面写着“DMXAPI”。\n\"\"\"\n ),\n ],\n role='model'\n ),\n finish_reason=\u003c***.STOP: 'STOP'\u003e,\n index=0\n)] create_time=None model_version='gemini-2.5-flash-image-preview' prompt_feedback=None response_id='OM_DaNCsNfTTqtsP4raP2QQ' usage_metadata=GenerateContentResponseUsageMetadata(\n candidates_token_count=19,\n prompt_token_count=14,\n prompt_tokens_details=[\n ModalityTokenCount(\n modality=\u003c***.TEXT: 'TEXT'\u003e,\n token_count=14\n ),\n ],\n total_token_count=33\n) automatic_function_calling_history=[] parsed=None (request id: 20250912154310540600564TYeuadrG)","type":"openai_error","param":"","code":"unknown_error"}}
🤖 AI解决方案
"Prompt is sensitive."
"提示内容敏感。"
原因分析:
您尝试使用 Gemini Image API 生成的提示词被判定为敏感内容,因此被拒绝。
解决方案:
修改您的提示词,移除任何可能被AI模型识别为不安全、不恰当或违反内容政策的元素。例如,避免涉及暴力、色情、仇恨言论、非法活动等主题。
预防措施:
- 在调用API之前,对用户输入的内容进行初步的敏感词过滤和审查。
- 详细阅读并遵循您使用的AI服务提供商(例如Google Gemini)的内容政策,以了解哪些类型的提示是被禁止的。