Claude Code with Anthropic API compatibility
Blog post from Ollama
Ollama v0.14.0 and later versions now support the Anthropic Messages API, enabling users to utilize Claude Code, Anthropic's agentic coding tool, with both local and cloud-based open-source models. This integration allows the execution of Claude Code on local machines or through Ollama's cloud services, with recommendations to use models with at least 64k tokens context length for optimal performance. Users can install Claude Code on various operating systems and configure environment variables to connect to Ollama, using models such as gpt-oss:20b and glm-4.7:cloud for coding purposes. Furthermore, existing applications leveraging the Anthropic SDK can be adapted to interface with Ollama by adjusting the base URL, and the platform supports tool calling, multi-turn conversations, and other advanced features. For comprehensive setup and configuration details, users are encouraged to consult the Claude Code guide.