I've been learning Claude Code for agentic development lately, but I didn't want to burn through paid API credits while I was still figuring out how the tool actually works. Every wrong prompt, every abandoned session, every "let me just try this real quick" costs money when you're hitting the Anthropic API directly.
So I spent a weekend building a small LiteLLM proxy that lets the Claude Code CLI talk to Amazon Nova on AWS Bedrock instead. Same agent loop, same tool calling, same workflow you'd get with Claude Code normally just pointed at a different backend, running on AWS credits instead of API billing.
The problem I was actually trying to solve
I looked at the usual options for cheap/free agentic coding practice and none of them held up for real sessions:
- Ollama locally - needs a beefy machine with real RAM and GPU headroom. Most people don't have that sitting around, and I didn't want to buy it just to practice.
- Free-tier providers like OpenRouter - you hit token limits within a handful of basic prompts. Not nearly enough runway for long-running agentic workflows where the model is calling tools back and forth for a while. I wanted something that let me learn tool use, agent loops, and long context handling without either of those walls showing up mid-session.
What I built
A LiteLLM proxy sitting between Claude Code's CLI and AWS Bedrock, translating requests so Claude Code thinks it's talking to Anthropic's API while it's actually routing to Amazon Nova.
A few things I locked down on purpose:
- No artificial session caps. It's self-hosted, so there's no vendor imposed limit on how long or how often I can run sessions.
- Everything runs on AWS credits, not API billing.
- Roughly 20ā35% cheaper per token than Claude Haiku pricing, based on current Bedrock rates.
- IAM scoped to a single model. I locked the role down so the proxy physically can't invoke anything more expensive, even by accident.
- AWS Budget alerts wired in, so I'm not finding out about a runaway bill after the fact. The Docker image and config are public if you want to poke at it yourself: https://github.com/PriyanshuValiya/Claude-Code/blob/main/README.md
Where this actually helps (and where it doesn't)
This is genuinely one of the more practical setups I've found for running long agentic sessions without either buying hardware or hitting a free-tier wall every ten minutes. If you're trying to internalize how these coding agents plan, call tools, and recover from errors, having room to run long sessions matters more than having the "best" model underneath.
But I want to be straight about what this is not: it's not free Claude. It's a translation layer that lets Claude Code's client talk to a different model entirely. Amazon Nova is not Claude, and the outputs, reasoning quality, and tool-calling behavior won't match what you'd get from Anthropic's actual models. If you're evaluating Claude Code itself, or building something you plan to ship, this setup will give you a skewed picture.
What it's good for is exactly what I built it for: learning the mechanics of agentic coding tools - the loop, the tool calls, the context management without worrying about a credit card every time a session runs long.
Takeaway
If you're in the same spot I was, wanting to learn Claude Code without either buying a GPU rig or getting cut off after three prompts, a Bedrock proxy is a reasonable middle ground. Just don't mistake it for the real thing when it's time to judge the model itself, that comparison only makes sense against Anthropic's actual API.
Top comments (9)
Nice write-up! I especially appreciate the distinction between learning the agent workflow and evaluating the model. One thing Iād also consider is keeping the proxy provider-agnostic. If the CLI only targets an OpenAI-compatible (or similar) interface, you can swap Bedrock, Anthropic, OpenAI, Gemini, or even a local model without changing the client. That makes the proxy a long-term architectural layer rather than just a cost optimization for one provider.
Wow, What a great idea to implement !!
I will try it definitely šš»
Glad you like the idea! š If you keep the proxy provider-agnostic, Iād also separate model capabilities from provider adapters. Let the client ask for capabilities like tool calling, vision, reasoning level, or prompt caching, and have each adapter translate those to the target provider. That way adding a new backend becomes mostly an adapter instead of changing the core proxy logic.
It also makes benchmarking much easier because youāre comparing providers behind the same abstraction instead of rewriting the client each time.
The skew is worse than model quality alone. Claude Code's system prompts and tool schemas are tuned for Claude's tool-calling behavior, so with LiteLLM translating to Nova you are also learning how the harness behaves under a mismatched model: tool-call retries, malformed JSON recovery, context compaction triggers all fire at different rates. Those failure mechanics are a big part of what you are trying to internalize, and they will look different against the real backend. A cheap calibration: log raw tool-call error rate through the proxy for a week, then run one short paid Claude session on the same repo and compare. One more line for the cost math: prompt caching. Long agentic sessions on Anthropic's API get big cached-input discounts, and whether Bedrock's prompt caching actually kicks in for Nova through a LiteLLM translation layer is worth checking, so the 20-35% per-token figure may not survive a real multi-hour session. Did LiteLLM pass through Claude Code's streamed tool_use blocks cleanly, or did you have to patch around dropped blocks?
Yess, You are absolutely correct and even I also figured it out with using actual anthropic's model. But this is only experiment purpose and for starting learning journey with Claude Code as free.
Interesting strategy! I appreciate that, rather than portraying it as a "free Claude" solution, you explicitly outlined both the advantages and the drawbacks. For developers who wish to experiment without worrying about API charges, using LiteLLM with Bedrock to understand agentic processes is a feasible idea. I appreciate you sharing the setup and the insights you gained.
Appreciate your words, that's made my day..
Interesting, starred/bookmarked it, might try it out!
So, if I understand correctly: Claude Code does not have a built-in mechanism to switch models, but you "tricked" it via this proxy (which probably intercepts the HTTP calls) ?
Cool idea!
Exactly @leob, you understood well, chears...