Skip to content

Add Anthropic Messages API endpoint (/v1/messages) for Claude-native clients (OpenClaw) #1727

@ramkrishna757575

Description

@ramkrishna757575

Summary
Manifest currently exposes only an OpenAI-compatible proxy at /v1/chat/completions. This forces Claude-native clients (OpenClaw, Claude Code, the Anthropic SDK, etc.) to use OpenAI format for requests that ultimately route to Claude models, which loses fidelity around tool blocks, thinking content, and cache_control markers. Adding /v1/messages would let Claude-native clients route through Manifest while preserving the Anthropic Messages format end-to-end.

Motivation
OpenClaw's manifest provider uses api: "openai-completions", which means tool-using conversations get serialized through OpenClaw's OpenAI translation path. That translation requests which strict OpenAI-compatible upstreams reject — specifically GitHub Copilot's Claude gateway, which returns 400 Bad Request on tool-result-bearing payloads.
If Manifest exposed /v1/messages, Claude-native clients could be configured with api: "anthropic-messages", completely bypassing the OpenAI translation step. The payload would stay in Anthropic format from the client all the way through to the upstream Claude provider — no tool block translation, no thinking content stripping, no role: "tool" vs role: "toolResult" mismatch.

Precedent
Several similar gateways have added Anthropic-compatible endpoints in 2025-2026:

LM Studio: /v1/messages (docs)
Databricks: /serving-endpoints/anthropic/v1/messages
LiteLLM: built-in Anthropic-compatible endpoint

Proposed scope
POST /v1/messages accepting Anthropic Messages API request format
Translate to whichever underlying provider format the routing decision lands on (Anthropic direct → passthrough; OpenAI / Copilot → translate to OpenAI Chat Completions)
Stream and non-stream both supported
Preserve cache_control markers when forwarded to providers that support them

Why this is the right place to solve it
The format-conversion bugs in question (the OpenClaw one being the most acute) are fundamentally about lossy translation from canonical Anthropic shape to OpenAI Chat Completions shape. Manifest sits at the perfect layer to do that translation correctly, once, in one well-tested place. Pushing it back to every individual client (OpenClaw, Hermes, Claude Code, etc.) means every client implements its own buggy translation.

My setup
OpenClaw v2026.4.22 → self-hosted Manifest → GitHub Copilot Claude Opus 4.6 / Haiku 4.5. Currently failing with 400 Bad request to upstream provider on any tool turn. Workaround is to bypass Manifest entirely for tool-heavy tiers, which loses Manifest's routing intelligence and other cool features like cost tracking/analytics, etc.

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