Skip to content
Open Code Review (ocr)

Open Code Review via Tokonomix

Point Alibaba's ocr reviewer at Tokonomix's Anthropic-compatible endpoint — diff-anchored review findings, backed by your choice of model.

Anthropic-compatible endpointAI code reviewer (CLI)Open sourcemacOS · Linux · Windows
Open Code Review — AI code reviewer, via Tokonomix

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.

Use the Anthropic-compatible endpoint

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 json
Want multi-model review?

A 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 false

Verify it works

  • Run ocr review on 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.

Model selection

Which model and endpoint should my agent use?

Pick by what your agent does, then swap the model id any time — every model in the catalog works through the same key.

What your agent doesUse this
Edits files / calls tools and streams responses (most coding agents)An Anthropic model via the Anthropic endpoint (tools + streaming both work)
Calls tools but does not need streaming (any model)The OpenAI-compatible endpoint with a single model id
Wants tools and streaming on a non-Anthropic modelRun non-streaming for now — streaming tool-calls on other providers is not enabled yet
Plain chat, no toolsEither endpoint; streaming is fine
Wants a cross-model verdict (consensus) on a high-stakes answerSet model to tokonomix-consensus on the OpenAI-compatible endpoint — note: consensus rejects tool requests (no tool-calling)
Endpoint & API reference (technical)

anthropic-messages → https://tokonomix.ai/api/anthropic — tools ✓, streaming ✓ (use an Anthropic model). openai-completions → https://tokonomix.ai/api/v1 — tools ✓ (single-model passthrough), streaming with tools not yet enabled. Plain chat: streaming works on both. Consensus: openai-completions, model tokonomix-consensus, no tools. Swap the model id to any slug returned by GET /api/v1/models.

Browse all models →

Related agents