Skip to content

[Bug]: Custom Provider Anthropic-Compatible 404 Error Due to Mismatch /v1 Behavior in Setup and Usage #21261

@17jmumford

Description

@17jmumford

Summary

Howdy! When setting up a custom provider and selecting "anthropic compatible", OpenClaw combines the base URL you enter with /messages. So, for something like Ollama you need to enter localhost:1234/v1, which then has /messages appended after.

BUT. Once you set that, OpenClaw then combines your base URL with /v1/messages! This causes the agent to fail. You can fix this by manually deleting the /v1 from the base URL in the config file.

Steps to reproduce

  1. Configure something like Ollama manually as a custom provider, selecting Anthropic compatible. The onboarding wizard will happily confirm that something like localhost:1234/v1 is a very valid and successful endpoint.
  2. Try using OpenClaw tui, you'll get a 404 not found error since it's hitting an invalid endpoint of /v1/v1/messages. Manually removing the /v1 from the config file will fix it.

Expected behavior

The setup script and regular usage of anthropic compatible providers should have identical behavior for calling models.

Actual behavior

Instead it appears they are different.

OpenClaw version

2026.2.15

Operating system

MacOS

Install method

No response

Logs, screenshots, and evidence

Logs from attaching a listener between Ollama and OpenClaw:

..z7Q:..POST /v1/v1/messages HTTP/1.1

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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