Skip to content

Droid incompatible with Grok 4 BYOK due to reasoning_effort param #656

@alexhamidi

Description

@alexhamidi

Problem

Using BYOK with Grok 4.1 returns a 400 error:
Error: 400 "Model grok-4-1-fast-reasoning does not support parameter reasoningEffort."

here is the config.json entry that caused the error:

{
      "model": "grok-4-1-fast-reasoning",
      "id": "custom:Grok-4.1-0",
      "index": 0,
      "baseUrl": "https://api.x.ai/v1",
      "apiKey": "xai-****",
      "displayName": "Grok 4.1",
      "maxOutputTokens": 8192,
      "noImageSupport": false,
      "provider": "openai"
 }

x.ai removed support of reasoning_effort after Grok-3, but the parameter is sent by droid automatically, which is why this fails.

Solution (temporary)

added an https proxy that removes the parameter:
mitmproxy --mode reverse:https://api.x.ai -s remove_reasoning.py

# remove_reasoning.py

import json
from mitmproxy import http

def request(flow: http.HTTPFlow) -> None:
    if "application/json" in flow.request.headers.get("Content-Type", ""):
        try:
            data = json.loads(flow.request.get_text())
            
            if "reasoning" in data:
                del data["reasoning"]
            
            flow.request.text = json.dumps(data)
        except json.JSONDecodeError:
            pass

then update config.json: "baseUrl": "http://localhost:8080/v1"

Suggestion

A long term fix would involve adding an unsupportedParams or something similar to config.json (essentially the inverse of extraArgs) so that unsupported params don't lead to 400s

Thank you! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions