api: implement anthropic api (#13600)

* api: add Anthropic Messages API compatibility layer

Add middleware to support the Anthropic Messages API format at /v1/messages.
This enables tools like Claude Code to work with Ollama local and cloud models through the
Anthropic API interface.
This commit is contained in:
Parth Sareen
2026-01-09 11:53:36 -08:00
committed by GitHub
parent 3cfe9fe146
commit 2b2cda7a2b
9 changed files with 2952 additions and 3 deletions

View File

@@ -14,6 +14,7 @@
* [API Reference](https://docs.ollama.com/api)
* [Modelfile Reference](https://docs.ollama.com/modelfile)
* [OpenAI Compatibility](https://docs.ollama.com/api/openai-compatibility)
* [Anthropic Compatibility](./api/anthropic-compatibility.mdx)
### Resources