Claude Code model router

Castari Proxy

Use Claude Agent SDK and Claude Code with other providers/models

Install

From source
git clone https://github.com/castari/castari-proxy.git

From the README

Castari Proxy

Castari Proxy lets you run the Claude Agent SDK against any model—including OpenRouter catalog models—without changing your agent logic. Install the castari-proxy wrapper, point it at the hosted Castari Worker, and keep using the same SDK APIs. The worker translates Anthropic-style Messages requests to whichever upstream (Anthropic or OpenRouter) matches the model string you provide.
Don't want to hit the hosted worker? See Self-Hosting the Worker for instructions to deploy your own copy.

Repo Overview

This repository contains three main components that work together to enable multi-provider support for the Claude Agent SDK:

1. Wrapper Package (src/)
The castari-proxy npm package provides queryCastari(), a drop-in replacement for the SDK's query() function. It:
- Resolves which provider to use based on the model string (e.g., or:gpt-5-mini → OpenRouter)
- Intercepts SDK network calls via a global fetch hook
- Injects routing headers and metadata into outgoing requests
- Handles subagent model inheritance for the Task tool

2. Cloudflare Worker (worker/)
A stateless proxy that translates between API formats. It:
- Routes requests to Anthropic (passthrough) or OpenRouter (with translation)
- Converts Anthropic Messages API ↔ OpenRouter Chat Completions format
- Handles streaming (SSE) translation with tool call assembly
- Enforces server tool policies (MCP, web search, etc.)

3. Demo Application (claude-agent-demo/)
A full-stack Next.js reference implementation of the Claude Agent SDK featuring:
- 12-model selection UI (3 Claude + 9 OpenRouter models)
- Streaming chat with real-time tool execution visualization
- Image upload support, extended thinking controls, session management
- Transcript recording and permission policies

Table of Contents
1. Repo…
Read the full README on GitHub

Details

Language
TypeScript
License
MIT
Last updated
16 November 2025

FAQ

What is Castari Proxy?

Use Claude Agent SDK and Claude Code with other providers/models It is a model router for Claude Code, from castari/castari-proxy on GitHub.

How do I install Castari Proxy?

Clone castari/castari-proxy from GitHub and follow the setup steps in its README.

Is Castari Proxy popular?

castari/castari-proxy has 89 GitHub stars and 16 forks. It was last updated on 16 November 2025.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.