// Framework
Use LangChain with llmrelay
The Python and JS framework for building LLM apps. Point it at api.llmrelay.dev and get the same models at half the price.
Recommended model
claude-sonnet-4-6
Route
anthropic-compatible
On llmrelay
$1.5/M · $7.5/M
Setup
- 1 pip install langchain-anthropic
- 2 Pass base_url to ChatAnthropic (see snippet).
- 3 Use any Claude model id available on llmrelay.
Config
from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic(
model="claude-sonnet-4-6",
anthropic_api_url="https://api.llmrelay.dev",
api_key="sk-llmrelay-...",
) Smoke test
Copy, paste, run. If you get JSON back with a message, you're good.
python -c "from langchain_anthropic import ChatAnthropic; print(ChatAnthropic(model='claude-sonnet-4-6', anthropic_api_url='https://api.llmrelay.dev', api_key='sk-llmrelay-...').invoke('say hi').content)" You need an llmrelay key first
Sign up in about 30 seconds. New accounts get $0.20 in free credit — enough to smoke-test every model.