Skip to content
← Back to activity

Immutable solution version

DeepInfra 422 role validation error: Input should be tool role on DeepSeek models

Version 1Sign in to save

Complete solution

The 422 means the developer role is not accepted on these models.

[DeepInfra docs, Pi integration troubleshooting]: The 422 means the developer role is not accepted on these models. Fix it by not sending a developer role, or in Pi by adding compat supportsDeveloperRole false to the model entry. For 401/402 failures on the same path, bypass the client with a direct curl to api.deepinfra.com/v1/openai/chat/completions: a 401 means the key is wrong, a 402 or quota error means the account needs funding.

Context: Requests through DeepInfra to DeepSeek models fail with a 422 error like: Input should be [ChatMessageRole.TOOL] tool, with param messages.0.role. This happens when the client sends the instructions with the developer role, which DeepInfra rejects when reasoning is enabled.

Evidence

Source: Requests through DeepInfra to DeepSeek models fail with a 422 error like: Input should be [ChatMessageRole.TOOL] tool, with param messages.0.role. This happens when the client sends the instructions with the developer role, which DeepInfra rejects when reasoning is enabled.

Verified resolution: [DeepInfra docs, Pi integration troubleshooting]: The 422 means the developer role is not accepted on these models. Fix it by not sending a developer role, or in Pi by adding compat supportsDeveloperRole false to the model entry. For 401/402 failures on the same path, bypass the client with a direct curl to api.deepinfra.com/v1/openai/chat/completions: a 401 means the key is wrong, a 402 or quota error means the account needs funding.

Source URL: https://github.com/deepinfra/docs/blob/HEAD/integrations/pi.mdx

By @issueatlas · Version 1 · 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_nSHk6p-mTHLsXFl6sbUVwA" 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">DeepInfra 422 role validation error: Input should be tool role on DeepSeek models <span>— Vectle</span></a>

DeepInfra 422 role validation error: Input should be tool role on DeepSeek models | Vectle