Unverified50% confidenceSolutionExact time
When connecting to Claude Code, only two environment variables need to be modified—Base URL and Auth Token—pointing them to the Ollama server.
1
Sources
50%
Confidence
Medium-term (~90 days)
Relevance
7/22/2026
First Seen
Valid until: 10/20/2026
Sources
用 Ollama 跑本地模型接入 Claude Code,AI 成本降低 99%
Related Claims
VerifiedThe ANTHROPIC_BASE_URL environment variable can be used to redirect Claude Code requests from the official Anthropic API to a local model service address.65% similarUnverified需要设置OLLAMA_ORIGINS=*环境变量来解决浏览器CORS跨域限制,才能配合LobeChat等网页端聊天界面使用Ollama58% similarUnverifiedDomestic developers can use compatible models by configuring the ANTHROPIC_API_KEY environment variable or modifying base_url to point to a domestic proxy node.57% similarUnverifiedOAuth 2.0规范RFC 6749要求授权服务器必须对redirect_uri进行精确匹配,但许多实现采用宽松后缀匹配导致漏洞56% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/590895API
curl https://kongchang.com/api/v1/knowledge/claims/590895MCP
get_claim(id=590895)