ocr has an edenai provider preset, so setup is a key and a model id.
Overview
Open Code Review (ocr) is Alibaba’s open-source command-line code reviewer. It reads your git diffs and runs an LLM agent that can read full files and search the codebase, then writes review comments. ocr review covers a diff and ocr scan covers whole files. The agent sends tool definitions with every request, so the model you choose must support function calling.
Prerequisites
- An Eden AI API key from app.edenai.run
ocrinstalled:
Setup
Select the provider and a model:ocr your key. It reads EDENAI_API_KEY from the environment when no key is stored in its config:
ocr config instead, run ocr config set providers.edenai.api_key YOUR_API_KEY. A stored key takes precedence over the environment variable, and ocr does not read .env files.
Check the connection, then review your changes:
edenai preset supplies the base URL https://api.edenai.run/v3 and the OpenAI-compatible protocol. ocr llm providers lists every built-in provider.
Model naming
Use a model name or~ alias from GET /v3/models, such as ~claude-sonnet-latest; a provider/model id pins one provider.
ocr lists suggested models for ocr config model, but they are suggestions, not restrictions: a --model override outside the list only prints a warning on stderr.
Switching models
Runocr config model, or set the model directly:
Troubleshooting
Authentication errors (401)
Confirm the key at app.edenai.run under API Keys. If you stored a key withocr config set, it overrides EDENAI_API_KEY, so overwrite it with ocr config set providers.edenai.api_key YOUR_API_KEY. A 401 with Invalid API key means the sk-eden-... key is wrong or revoked; Invalid token means the credential is not an Eden AI key at all.
The review fails on tool calls
ocr sends tool definitions with every request. Use a model that supports function calling, such as the ones on this page.
Next Steps
- Chat Completions - Core LLM endpoint
- List LLM Models - Browse available providers and models
- OpenAI SDK (Python) - Direct SDK usage