[Bug]: OpenAI provider fails with "Invalid value: 'custom'" – tool parameter incompatibility
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
The OpenAI provider returns HTTP 400 "Invalid value: 'custom'" for every agent turn, preventing use of any OpenAI model (gpt-4o-mini, o3-mini) with OpenClaw.
Steps to reproduce
Set the default model to OpenAI: openclaw config set agents.defaults.model.primary "openai/gpt-4o-mini"
Run any agent turn with --local: openclaw agent --agent main --local --message "Hello"
Expected behavior
The agent should respond normally via the OpenAI API. A direct curl call using the same OpenAI API key succeeds.
Actual behavior
The agent fails immediately with the error: Error: { "type": "error", "error": { "type": "invalid_request_error", "code": "unknown_parameter", "message": "Invalid value: 'custom'", "param": "tools" }, "status": 400 }
OpenClaw version
2026.7.1-beta.1 (also reproduced on 2026.6.11)
Operating system
macOS 12.7.6
Install method
npm global
Model
openai/gpt-4o-mini, openai/o3-mini
Provider / routing chain
openclaw -> openai
Additional provider/model setup details
Default route is openclaw -> openai. openai provider configured at models.providers.openai in openclaw.json. API key is valid – direct curl calls work, but OpenClaw's embedded agent rejects.
Logs
[agent/embedded] embedded run failover decision: runId=… stage=prompt decision=surface_error reason=none from=openai/gpt-4o-mini profile=… rawError={ "type": "error", "error": { "type": "invalid_request_error", "code": "unknown_parameter", "message": "Invalid value: 'custom'", "param": "tools" }, "status": 400 }Screenshots, recordings, and evidence
aavulas@aavulas-2 / % openclaw agent --agent main --local --model openai/gpt-4o-mini --message "Say hello from OpenAI through OpenClaw." │ ◇
OpenClaw 2026.7.1-beta.1 (4eb1d33) I can run local, remote, or purely on vibes—results may vary with DNS.
11:58:02 [agent/embedded] codex app-server one-shot cleanup retired shared client 11:58:02 [agent/embedded] embedded run failover decision: runId=e0d467ad-a100-4311-9a55-fad882f69a8d stage=prompt decision=surface_error reason=none from=openai/gpt-4o-mini profile=sha256:f7d43a588b65 rawError={ "type": "error", "error": { "type": "invalid_request_error", "code": "unknown_parameter", "message": "Invalid value: 'custom'", "param": "tools" }, "status": 400 } 11:58:02 [diagnostic] lane task error: lane=main durationMs=8466 error="Error: { "type": "error", "error": { "type": "invalid_request_error", "code": "unknown_parameter", "message": "Invalid value: 'custom'", "param": "tools" }, "status": 400 }" 11:58:02 [diagnostic] lane task error: lane=session:agent:main:main durationMs=8473 error="Error: { "type": "error", "error": { "type": "invalid_request_error", "code": "unknown_parameter", "message": "Invalid value: 'custom'", "param": "tools" }, "status": 400 }" Error: { "type": "error", "error": { "type": "invalid_request_error", "code": "unknown_parameter", "message": "Invalid value: 'custom'", "param": "tools" }, "status": 400 } aavulas@aavulas-2 / %
Impact and severity
Affected: Any user attempting to use OpenAI models with OpenClaw Severity: High (blocks all OpenAI usage) Frequency: Always (100% of attempts) Consequence: OpenAI free-tier tokens cannot be used; users forced to rely on NVIDIA or other providers
Additional information
The issue appears to be that OpenClaw sends "tools":"custom" in the request body, which OpenAI's API does not accept. NVIDIA, Google Gemini, and Qwen providers work correctly. The issue persists across both the stable and beta channels as of 2026-07-04. The workaround is to use NVIDIA or another non-OpenAI provider.
Source: openclaw/openclaw