docs: clarify OpenRouter configuration (#1123)

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
Frank
2026-03-13 07:12:30 -07:00
committed by GitHub
parent 5a8481416f
commit 918ba6b5bf
3 changed files with 31 additions and 2 deletions

View File

@@ -94,9 +94,17 @@ DeerFlow has newly integrated the intelligent search and crawling toolset indepe
api_key: $OPENAI_API_KEY # API key (recommended: use env var)
max_tokens: 4096 # Maximum tokens per request
temperature: 0.7 # Sampling temperature
- name: openrouter-gemini-2.5-flash
display_name: Gemini 2.5 Flash (OpenRouter)
use: langchain_openai:ChatOpenAI
model: google/gemini-2.5-flash-preview
api_key: $OPENAI_API_KEY # OpenRouter still uses the OpenAI-compatible field name here
base_url: https://openrouter.ai/api/v1
```
OpenRouter and similar OpenAI-compatible gateways should be configured with `langchain_openai:ChatOpenAI` plus `base_url`. If you prefer a provider-specific environment variable name, point `api_key` at that variable explicitly (for example `api_key: $OPENROUTER_API_KEY`).
4. **Set API keys for your configured model(s)**
Choose one of the following methods:
@@ -107,6 +115,7 @@ DeerFlow has newly integrated the intelligent search and crawling toolset indepe
```bash
TAVILY_API_KEY=your-tavily-api-key
OPENAI_API_KEY=your-openai-api-key
# OpenRouter also uses OPENAI_API_KEY when your config uses langchain_openai:ChatOpenAI + base_url.
# Add other provider keys as needed
INFOQUEST_API_KEY=your-infoquest-api-key
```

View File

@@ -25,7 +25,7 @@ models:
- DeepSeek (`langchain_deepseek:ChatDeepSeek`)
- Any LangChain-compatible provider
For OpenAI-compatible gateways (for example Novita), keep using `langchain_openai:ChatOpenAI` and set `base_url`:
For OpenAI-compatible gateways (for example Novita or OpenRouter), keep using `langchain_openai:ChatOpenAI` and set `base_url`:
```yaml
models:
@@ -40,8 +40,17 @@ models:
extra_body:
thinking:
type: enabled
- name: openrouter-gemini-2.5-flash
display_name: Gemini 2.5 Flash (OpenRouter)
use: langchain_openai:ChatOpenAI
model: google/gemini-2.5-flash-preview
api_key: $OPENAI_API_KEY
base_url: https://openrouter.ai/api/v1
```
If your OpenRouter key lives in a different environment variable name, point `api_key` at that variable explicitly (for example `api_key: $OPENROUTER_API_KEY`).
**Thinking Models**:
Some models support "thinking" mode for complex reasoning:

View File

@@ -106,6 +106,17 @@ models:
# thinking:
# type: enabled
# Example: OpenRouter (OpenAI-compatible)
# OpenRouter models use the same ChatOpenAI + base_url pattern as other OpenAI-compatible gateways.
# - name: openrouter-gemini-2.5-flash
# display_name: Gemini 2.5 Flash (OpenRouter)
# use: langchain_openai:ChatOpenAI
# model: google/gemini-2.5-flash-preview
# api_key: $OPENAI_API_KEY
# base_url: https://openrouter.ai/api/v1
# max_tokens: 8192
# temperature: 0.7
# ============================================================================
# Tool Groups Configuration
# ============================================================================