mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
docs(config): clarify openai-compatible providers
This commit is contained in:
@@ -163,7 +163,7 @@ qwen --version
|
|||||||
code [options] [prompt]
|
code [options] [prompt]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--model <name> Override the model (gpt-5.1, claude-opus, etc.)
|
--model <name> Override the model for the active provider (e.g. gpt-5.1)
|
||||||
--read-only Prevent file modifications
|
--read-only Prevent file modifications
|
||||||
--no-approval Skip approval prompts (use with caution)
|
--no-approval Skip approval prompts (use with caution)
|
||||||
--config <key=val> Override config values
|
--config <key=val> Override config values
|
||||||
@@ -174,6 +174,8 @@ Options:
|
|||||||
--version Show version number
|
--version Show version number
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: `--model` only changes the model name sent to the active provider. To use a different provider, set `model_provider` in `config.toml`. Providers must expose an OpenAI-compatible API (Chat Completions or Responses).
|
||||||
|
|
||||||
 
|
 
|
||||||
## Memory & project docs
|
## Memory & project docs
|
||||||
|
|
||||||
@@ -265,7 +267,7 @@ model_reasoning_summary = "detailed"
|
|||||||
|
|
||||||
- `CODE_HOME`: Override config directory location
|
- `CODE_HOME`: Override config directory location
|
||||||
- `OPENAI_API_KEY`: Use API key instead of ChatGPT auth
|
- `OPENAI_API_KEY`: Use API key instead of ChatGPT auth
|
||||||
- `OPENAI_BASE_URL`: Use alternative API endpoints
|
- `OPENAI_BASE_URL`: Use OpenAI-compatible API endpoints (chat or responses)
|
||||||
- `OPENAI_WIRE_API`: Force the built-in OpenAI provider to use `chat` or `responses` wiring
|
- `OPENAI_WIRE_API`: Force the built-in OpenAI provider to use `chat` or `responses` wiring
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ model = "o3" # overrides the default of "gpt-5.1"
|
|||||||
|
|
||||||
## model_providers
|
## model_providers
|
||||||
|
|
||||||
This option lets you override and amend the default set of model providers bundled with Codex. This value is a map where the key is the value to use with `model_provider` to select the corresponding provider.
|
This option lets you override and amend the default set of model providers bundled with Codex. This value is a map where the key is the value to use with `model_provider` to select the corresponding provider. Providers must expose an OpenAI-compatible HTTP API (Chat Completions or Responses); native Anthropic/Gemini APIs are not supported directly without a proxy.
|
||||||
|
|
||||||
For example, if you wanted to add a provider that uses the OpenAI 4o model via the chat completions API, then you could add the following configuration:
|
For example, if you wanted to add a provider that uses the OpenAI 4o model via the chat completions API, then you could add the following configuration:
|
||||||
|
|
||||||
|
|||||||
+15
-1
@@ -27,7 +27,7 @@ model = "o3" # overrides the default of "gpt-5.1-codex"
|
|||||||
|
|
||||||
## model_providers
|
## model_providers
|
||||||
|
|
||||||
This option lets you override and amend the default set of model providers bundled with Code. This value is a map where the key is the value to use with `model_provider` to select the corresponding provider.
|
This option lets you override and amend the default set of model providers bundled with Code. This value is a map where the key is the value to use with `model_provider` to select the corresponding provider. Providers must expose an OpenAI-compatible HTTP API (Chat Completions or Responses); native Anthropic/Gemini APIs are not supported directly without a proxy.
|
||||||
|
|
||||||
For example, if you wanted to add a provider that uses the OpenAI 4o model via the chat completions API, then you could add the following configuration:
|
For example, if you wanted to add a provider that uses the OpenAI 4o model via the chat completions API, then you could add the following configuration:
|
||||||
|
|
||||||
@@ -70,6 +70,20 @@ base_url = "https://api.mistral.ai/v1"
|
|||||||
env_key = "MISTRAL_API_KEY"
|
env_key = "MISTRAL_API_KEY"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or a proxy that converts OpenAI-compatible requests to another vendor (e.g., Anthropic or Gemini):
|
||||||
|
|
||||||
|
```toml
|
||||||
|
model = "claude-opus-4.5"
|
||||||
|
model_provider = "claude-proxy"
|
||||||
|
|
||||||
|
[model_providers.claude-proxy]
|
||||||
|
name = "Claude (proxy)"
|
||||||
|
base_url = "http://127.0.0.1:8000/v1"
|
||||||
|
env_key = "ANTHROPIC_API_KEY"
|
||||||
|
wire_api = "responses" # or "chat" if your proxy only supports chat-completions
|
||||||
|
requires_openai_auth = false
|
||||||
|
```
|
||||||
|
|
||||||
It is also possible to configure a provider to include extra HTTP headers with a request. These can be hardcoded values (`http_headers`) or values read from environment variables (`env_http_headers`):
|
It is also possible to configure a provider to include extra HTTP headers with a request. These can be hardcoded values (`http_headers`) or values read from environment variables (`env_http_headers`):
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
|||||||
Reference in New Issue
Block a user