You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --openai-api-target and --anthropic-api-target flags for custom LLM endpoints
Adds support for routing OpenAI and Anthropic API proxy traffic to custom
endpoints, enabling use with internal LLM routers, Azure OpenAI, and other
OpenAI/Anthropic-compatible APIs.
Follows the existing --copilot-api-target pattern.
Changes:
- cli.ts: Add --openai-api-target and --anthropic-api-target CLI flags
- types.ts: Add openaiApiTarget and anthropicApiTarget to WrapperConfig
- docker-manager.ts: Pass OPENAI_API_TARGET / ANTHROPIC_API_TARGET to proxy container
- containers/api-proxy/server.js: Read OPENAI_API_TARGET / ANTHROPIC_API_TARGET
env vars (defaulting to api.openai.com / api.anthropic.com) instead of hardcoding
Closes: github/gh-aw#20590
Use `--openai-api-target` or `--anthropic-api-target` to route requests to a custom endpoint (e.g., an internal LLM router, Azure OpenAI, or any OpenAI/Anthropic-compatible API) instead of the public defaults.
107
+
108
+
```bash
109
+
# Route OpenAI/Codex requests to an internal LLM router
- A plain hostname: `llm-router.internal.example.com`
130
+
- A `host:port` pair: `llm-router.internal.example.com:8443`
131
+
- A full URL (scheme + host): `https://llm-router.internal.example.com/v1`
132
+
133
+
Both flags can also be set via environment variables:
134
+
-`OPENAI_API_TARGET` — equivalent to `--openai-api-target`
135
+
-`ANTHROPIC_API_TARGET` — equivalent to `--anthropic-api-target`
136
+
104
137
## Environment variables
105
138
106
139
AWF manages environment variables differently across the three containers (squid, api-proxy, agent) to ensure secure credential isolation.
@@ -123,6 +156,9 @@ The API proxy sidecar receives **real credentials** and routing configuration:
123
156
|`OPENAI_API_KEY`| Real API key |`--enable-api-proxy` and env set | OpenAI API key (injected into requests) |
124
157
|`ANTHROPIC_API_KEY`| Real API key |`--enable-api-proxy` and env set | Anthropic API key (injected into requests) |
125
158
|`COPILOT_GITHUB_TOKEN`| Real token |`--enable-api-proxy` and env set | GitHub Copilot token (injected into requests) |
159
+
|`OPENAI_API_TARGET`| Hostname or host:port|`--openai-api-target` or env set | Custom upstream for OpenAI requests (default: `api.openai.com`) |
160
+
|`ANTHROPIC_API_TARGET`| Hostname or host:port|`--anthropic-api-target` or env set | Custom upstream for Anthropic requests (default: `api.anthropic.com`) |
161
+
|`COPILOT_API_TARGET`| Hostname |`--copilot-api-target` or env set | Custom upstream for Copilot requests (default: `api.githubcopilot.com`) |
126
162
|`HTTP_PROXY`|`http://172.30.0.10:3128`| Always | Routes through Squid for domain filtering |
127
163
|`HTTPS_PROXY`|`http://172.30.0.10:3128`| Always | Routes through Squid for domain filtering |
0 commit comments