We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb48e2f commit 6ffda69Copy full SHA for 6ffda69
1 file changed
openhands-sdk/openhands/sdk/llm/llm.py
@@ -504,6 +504,13 @@ def _coerce_inputs(cls, data):
504
# Use `or` instead of dict.get() to handle explicit None values
505
d["base_url"] = d.get("base_url") or "https://llm-proxy.app.all-hands.dev/"
506
507
+ # Fix base_url for direct OpenAI - API expects /v1 suffix
508
+ # If base_url is "https://api.openai.com", set to None to use LiteLLM default
509
+ if model_val.startswith("openai/"):
510
+ base = d.get("base_url")
511
+ if base == "https://api.openai.com" or base == "https://api.openai.com/":
512
+ d["base_url"] = None # Let LiteLLM use its default which includes /v1
513
+
514
return d
515
516
@model_validator(mode="after")
0 commit comments