What is Open Code Review?
Open Code Review (Alibaba’s ocr CLI) is an open-source AI code reviewer. It walks a diff, calls a model with tools to gather context, and emits diff-anchored findings as JSON — ideal for CI gating.
ocr drives a tool-calling loop. Tool-call passthrough goes through Tokonomix’s Anthropic-compatible endpoint (/api/anthropic/v1); the OpenAI-compatible /api/v1 path is consensus-oriented and strips client-side tool-calls. Point ocr at the Anthropic base.
Why route Open Code Review through Tokonomix?
- Drive the reviewer with any tool-capable model on one key (e.g.
anthropic/claude-sonnet-4-6). - Keep the diff-anchored JSON output for CI gating, unchanged.
- Per-call spend caps bound review cost on large diffs.
- Region / origin routing keeps a code-reading reviewer compliant.
Configure ocr for Tokonomix
Set ocr’s LLM URL to the Anthropic-compatible endpoint, your token, a tool-capable model, and enable the Anthropic wire format.
ocr config set llm.url https://tokonomix.ai/api/anthropic/v1/messages
ocr config set llm.auth_token tok_live_your-key
ocr config set llm.model anthropic/claude-sonnet-4-6
ocr config set llm.use_anthropic true
ocr review --from origin/main --to HEAD --format jsonA native tokonomix-consensus-review slug (in progress) returns diff-anchored findings as JSON straight through the consensus pipeline — no client-side tool-calling required.
# Alternative — consensus-only review via the OpenAI-compatible path.
# No client-side tool-calling: ocr sends the diff and tokonomix-consensus
# returns a cross-family verdict. Use this for a multi-model review instead
# of ocr's local tool-driven loop.
ocr config set llm.url https://tokonomix.ai/api/v1/chat/completions
ocr config set llm.auth_token tok_live_your-key
ocr config set llm.model tokonomix-consensus
ocr config set llm.use_anthropic falseVerify it works
- Run
ocr reviewon a small diff and confirm JSON findings come back. - Check the call and token usage in your Tokonomix dashboard.
- Wire the JSON output into your CI gate.

