https://www.boundaryml.com logo
claude w/ non claude models
# general
b
@dexlayer in todays session u mentioned u use claude code harness for codelayer, u mean, using claude agents sdk as harness? If yes, how do u replace sonnet models there with other non anthropic models
d
thanks dude! we use the
claude -p
- headless sdk via a package wrapper we made called
claudecode-go
so you can swap out the models by setting ANTHROPIC_BASE_URL to a proxy (we wrote one in go that runs on localhost in codelayer) and then it translates the LLM calls on the fly to openrouter or baseten or etc etc
b
Thanks. Any idea where is this present in Claude Agents Sdk. Don't seem to find the option for ANTHROPIC_BASE_URL there except just a model name option
d
its not supported by the claude team, they don't want you to use this technique lol
but you can set an env var
and it will override where the traffic goes