Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/reactor-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ reactors: [] # optional: a multi-reactor host (see below)
Global flags `--state-dir`, `--project`, `--json`, `--offline` override the file
on every command.

The built-in providers are `openrouter` (the default), `openai`, `anthropic`,
`google`, and `orcarouter`; each supplies its own endpoint and key env var
(`ORCAROUTER_API_KEY` for OrcaRouter). To point at any other OpenAI-compatible
endpoint, set `base_url` + `api_key_env` explicitly.

### Sandbox

The `sandbox` block is the render **threat-model** knob:
Expand Down
10 changes: 10 additions & 0 deletions packages/reactor-cli/src/__tests__/provider-plan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ describe('resolveProviderPlan', () => {
assert.equal(google.custom, true);
});

it('resolves the orcarouter built-in to the OrcaRouter gateway base URL + key env', () => {
const orcarouter = resolveProviderPlan({ provider: 'orcarouter' });
assert.equal(orcarouter.provider, 'orcarouter');
assert.equal(orcarouter.baseURL, 'https://api.orcarouter.ai/v1');
assert.equal(orcarouter.apiKeyEnv, 'ORCAROUTER_API_KEY');
assert.equal(orcarouter.transport, 'openai-compat');
// A non-default provider: the CLI builds + injects the scoped provider.
assert.equal(orcarouter.custom, true);
});

it('routes the anthropic built-in through the NATIVE adapter (no compat base URL)', () => {
const anthropic = resolveProviderPlan({ provider: 'anthropic' });
assert.equal(anthropic.apiKeyEnv, 'ANTHROPIC_API_KEY');
Expand Down
6 changes: 3 additions & 3 deletions packages/reactor-cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ state:
dir: ./.reactor

model:
# Provider: openrouter (default) | openai | anthropic | google | <custom>.
# Provider: openrouter (default) | openai | anthropic | google | orcarouter | <custom>.
# A built-in supplies its own endpoint + key env (OPENROUTER_API_KEY,
# OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY). To use another vendor,
# set base_url + api_key_env. See docs: /cli/configuration#choosing-a-model-provider
# OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, ORCAROUTER_API_KEY).
# To use another vendor, set base_url + api_key_env. See docs: /cli/configuration#choosing-a-model-provider
provider: openrouter
render_model: google/gemini-3.5-flash
compile_model: google/gemini-3.5-flash
Expand Down
2 changes: 1 addition & 1 deletion packages/reactor-cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface ModelConfig {
readonly max_turns: number;
/**
* Override the provider's OpenAI-compatible base URL. Optional: a built-in
* provider (openrouter/openai/anthropic/google) supplies its own. Set this (with
* provider (openrouter/openai/anthropic/google/orcarouter) supplies its own. Set this (with
* {@link api_key_env}) to point at any other OpenAI-compatible endpoint.
*/
readonly base_url?: string;
Expand Down
4 changes: 4 additions & 0 deletions packages/reactor-cli/src/model/provider-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ const KNOWN_PROVIDERS: Readonly<Record<string, KnownProvider>> = Object.freeze({
baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai/',
apiKeyEnv: 'GEMINI_API_KEY',
},
orcarouter: {
baseURL: 'https://api.orcarouter.ai/v1',
apiKeyEnv: 'ORCAROUTER_API_KEY',
},
});

/** The provider labels the CLI knows out of the box (for error guidance). */
Expand Down