Skip to content
DioNanosPublic

About

High-performance Rust API bridge for Codex, codex-vl, Anthropic Messages, OpenAI chat, and Responses-compatible providers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

53 Commits

Folders and files

Repository files navigation

AnthMorph

Release CI Tests npm License: Apache-2.0 Rust Platforms API Local First

AnthMorph is a high-performance Rust API bridge for modern AI coding clients. Its main job is to let Codex and codex-vl use providers that do not expose the latest OpenAI /responses API by translating, normalizing, and streaming across Anthropic Messages, OpenAI legacy chat-completions, and Responses-style traffic.

Use it when a provider is powerful but speaks the wrong wire format for your client. AnthMorph keeps the local client surface stable, adapts model names and tool calls, applies local auth/rate-limit policy, and forwards to the selected backend with minimal runtime overhead.

Project Status

  • Current source line: 0.3.0 (CLI migration: MIGRATION-0.3).
  • Bundled prebuilt artifacts remain 0.2.4 until a separately approved release rebuild; do not package them as 0.3.0.
  • Primary Codex API: POST /v1/responses
  • Anthropic ingress: POST /v1/messages, POST /v1/messages/count_tokens
  • OpenAI legacy ingress: POST /v1/chat/completions, POST /chat/completions
  • Operational APIs: GET /v1/models, GET /health
  • Target clients: Codex and codex-vl latest, plus Anthropic/OpenAI-compatible clients
  • Target platforms: macOS, Linux, and Termux

What It Does

  • Translates Codex/codex-vl Responses traffic to native Responses or legacy chat-completions backends.
  • Accepts Anthropic Messages API traffic and adapts it to OpenAI-compatible or Anthropic-compatible backends.
  • Accepts OpenAI legacy chat-completions traffic for clients and tools that still use /chat/completions.
  • Streams Server-Sent Events for supported streaming paths.
  • Normalizes configured/default models for clients that send default or Claude-style model names.
  • Shortens long function/tool names for providers with stricter tool-name limits.
  • Supports local ingress auth, backend API key forwarding, CORS allow-lists, and per-client rate limiting.
  • Serves /v1/models from backend discovery plus a local fallback model cache.

Install

Global npm install:

npm install -g @mmmbuto/anthmorph

On macOS, npm install builds the local binary with Cargo.

Local source build:

cargo build --release

Run against a legacy OpenAI-compatible chat backend:

ANTHMORPH_BACKEND_URL=https://api.example.com/v1 \
ANTHMORPH_BACKEND_PROFILE=openai-generic \
ANTHMORPH_UPSTREAM_API=chat-completions \
ANTHMORPH_PRIMARY_MODEL=example/model \
ANTHMORPH_API_KEY="$PROVIDER_API_KEY" \
PORT=9876 \
anthmorph

Run against a native Responses backend:

ANTHMORPH_BACKEND_URL=https://api.example.com/v1 \
ANTHMORPH_BACKEND_PROFILE=openai-generic \
ANTHMORPH_UPSTREAM_API=responses \
ANTHMORPH_PRIMARY_MODEL=example/model \
ANTHMORPH_API_KEY="$PROVIDER_API_KEY" \
PORT=9876 \
anthmorph

Codex and codex-vl

Point Codex or codex-vl at AnthMorph with Responses wire format:

model = "example/model"
model_provider = "anthmorph"

[model_providers.anthmorph]
name = "Provider via AnthMorph"
base_url = "http://127.0.0.1:9876/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
requires_openai_auth = false

Codex sends /v1/responses to AnthMorph. AnthMorph then chooses the configured upstream mode:

ANTHMORPH_UPSTREAM_API=responses          -> {BACKEND_URL}/responses
ANTHMORPH_UPSTREAM_API=chat-completions   -> {BACKEND_URL}/chat/completions

Runtime Surface

POST http://127.0.0.1:9876/v1/responses
POST http://127.0.0.1:9876/v1/messages
POST http://127.0.0.1:9876/v1/messages/count_tokens
POST http://127.0.0.1:9876/v1/chat/completions
POST http://127.0.0.1:9876/chat/completions
GET  http://127.0.0.1:9876/v1/models
GET  http://127.0.0.1:9876/health

Environment

Minimum direct environment:

PORT=9876
ANTHMORPH_BACKEND_URL=https://api.example.com/v1
ANTHMORPH_BACKEND_PROFILE=openai-generic
ANTHMORPH_UPSTREAM_API=chat-completions
ANTHMORPH_PRIMARY_MODEL=example/model
ANTHMORPH_API_KEY=...

Optional:

ANTHMORPH_REASONING_MODEL=...
ANTHMORPH_INGRESS_API_KEY=...
ANTHMORPH_ALLOWED_ORIGINS=https://example.test
ANTHMORPH_RATE_LIMIT_PER_MINUTE=60
ANTHMORPH_STRICT_MODEL=true
ANTHMORPH_STREAM_CHUNK_TIMEOUT_SECS=30

Validation

Local Rust tests:

cargo test

Docker release checks:

./scripts/docker_release_checks.sh

Docs

License

Apache-2.0. See LICENSE.

Copyright (c) 2026 DioNanos


Contact

Maintained by DioNanos.

About

High-performance Rust API bridge for Codex, codex-vl, Anthropic Messages, OpenAI chat, and Responses-compatible providers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages