Skip to content

[Bug]: Erroenous HTTP 400 errors when using Venice.AI due to too high hard-coded max_completion_tokens #38168

@joshua-mo-143

Description

@joshua-mo-143

Bug type

Behavior bug (incorrect output/state without crash)

Summary

After running openclaw onboard with a Venice.ai API key, the agent fails with 400 errors on every request. Two issues in the generated model config:

  1. maxTokens: 8192 is set for all Venice models, but several models (e.g. llama-3.3-70b, mistral-31-24b) only allow max_completion_tokens up to 4096. Venice returns: 400 "max_completion_tokens (8192) exceeds the maximum allowed for model 'llama-3.3-70b' (4096)"
  2. The agent sends tools in every request, but some Venice models (e.g. deepseek-v3.2, hermes-3-llama-3.1-405b) don't support function calling. Venice returns 400 {"tools is not supported by this model"}
    which pi-ai surfaces as "400 status code (no body)" since it doesn't parse the error JSON.

edit: This issue can technically be worked around by using a model that can support 8192 or more max tokens, but the default setup basically being broken is a huge UX issue

Steps to reproduce

  1. Run openclaw onboard with a Venice.ai API key.
  2. Start the gateway and try to send a message.

Expected behavior

A reply should be sent back.

Actual behavior

400 HTTP error related to max_completion_tokens

OpenClaw version

2026.3.2

Operating system

Linux/Ubuntu

Install method

One-liner bash script

Logs, screenshots, and evidence

Working:

joshuamo@pop-os:~$ openclaw agent -m "Hello world"

🦞 OpenClaw 2026.3.2 (85377a2) — More integrations than your therapist's intake form.

Gateway agent failed; falling back to embedded: Error: Pass --to <E.164>, --session-id, or --agent to choose a session
Error: Pass --to <E.164>, --session-id, or --agent to choose a session
joshuamo@pop-os:~$ openclaw agent -m "Hello world"^C
joshuamo@pop-os:~$ openclaw agent --agent main -m "Hello world"

🦞 OpenClaw 2026.3.2 (85377a2) — Your config is valid, your assumptions are not.



Hello world! I'm Qwen 3 235B A22B Instruct 2507, live and operational on Venice.ai. How can I help you today?


Not working:

joshuamo@pop-os:~$ openclaw agent --agent main -m "Hello world"

🦞 OpenClaw 2026.3.2 (85377a2) — If you can describe it, I can probably automate it—or at least make it funnier.

│
◇
400 "max_completion_tokens (8192) exceeds the maximum allowed for model 'llama-3.3-70b' (4096). See the maxCompletionTokens field in GET /models for each model's limit."


Not working (attempted to change max_completion_models in setting to 4096):

joshuamo@pop-os:~$ openclaw agent --agent main -m "Hello world"

🦞 OpenClaw 2026.3.2 (85377a2) — I speak fluent bash, mild sarcasm, and aggressive tab-completion energy.

│
◇
400 "max_completion_tokens (8192) exceeds the maximum allowed for model 'llama-3.3-70b' (4096). See the maxCompletionTokens field in GET /models for each model's limit."

Impact and severity

Affects basically everyone using Venice.ai with the default setup. We're getting user support tickets from Venice.ai users about this, so being able to solve this issue quickly would be awesome.

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbug:behaviorIncorrect behavior without a crashdedupe:parentPrimary canonical item in dedupe cluster

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions