Repository navigation
BYOK Azure: wire_api: completions ignored; hardcoded api-version rejected by Azure OpenAI Responses API #3208
Description
Summary
When the GitHub Copilot CLI is configured (via github-copilot-sdk's
ProviderConfig) to use type: azure with wire_api: completions,
the CLI ignores wire_api and sends requests to Azure OpenAI's
Responses API endpoint (/openai/responses) anyway. It also
appears to use a hardcoded api-version (per copilot/session.py:819
SDK docstring, defaults to 2024-10-21) regardless of what's passed
in azure.api_version, which Azure OpenAI rejects for the Responses
API path:
400 Azure OpenAI Responses API is enabled only for api-version
2025-03-01-preview and later
This makes BYOK against Azure OpenAI / Microsoft Foundry deployments
non-functional today.
Environment
copilotCLI:0.0.353(Commitf8fd3e3), installed via Homebrewgithub-copilot-sdk:0.3.0(Python wrapper)- Host: macOS 25.4.0 / arm64
- Upstream: Azure OpenAI deployment provisioned through Microsoft
Foundry hub (endpointhttps://<account>.openai.azure.com) - Auth: Azure AD bearer token via
az account get-access-token --resource https://cognitiveservices.azure.com
Reproducer
import asyncio
from copilot import CopilotClient, ProviderConfig
async def main() -> None:
client = CopilotClient()
provider = ProviderConfig(
type="azure",
wire_api="completions", # asks for Chat Completions
base_url="https://<your-aoai-endpoint>.openai.azure.com",
bearer_token="<az-ad-token>",
azure={"api_version": "2025-04-01-preview"}, # explicit modern version
)
session = await client.create_session(
model="gpt-5",
working_directory="/tmp/test",
provider=provider,
on_permission_request=lambda *a, **kw: {"behavior": "allow"},
)
response = await session.send_and_wait("Write hello.py")
print(response)
asyncio.run(main())Expected behavior
The Copilot CLI sends requests to
<endpoint>/openai/v1/chat/completions (Chat Completions endpoint,
no api-version constraint), OR honors the explicit
azure.api_version passed in the ProviderConfig.
Actual behavior
~/.copilot/logs/process-*.log shows:
[INFO] Using custom provider: type=azure, baseUrl=<endpoint>,
wireApi=responses ← wire_api was set to "completions"
[ERROR] {
"code": "BadRequest",
"message": "Azure OpenAI Responses API is enabled only for
api-version 2025-03-01-preview and later"
}
Two distinct issues:
wire_api: completionsis ignored — log line shows
wireApi=responseseven when SDK input was
wire_api="completions".azure.api_versionis ignored or overridden — the request
that reaches Azure OpenAI uses a version older than
2025-03-01-previewdespite us setting
azure.api_version="2025-04-01-preview"inProviderConfig.
The same error reproduces with wire_api: responses, model: gpt-5.4, and explicit azure.api_version overrides up to
2026-01-01-preview.
Suggested fixes (any one would unblock BYOK Azure paths)
- Honor
wire_api: completionsfortype: azure— route to
<endpoint>/openai/v1/chat/completionsinstead of
/openai/responseswhen set. (Cleanest; matches the SDK
schema'swire_api: Literal['completions', 'responses']typing.) - Honor
azure.api_version— pass through to the request URL
query string (?api-version=...) so operators can opt into
newer Azure API surfaces. - Bump the hardcoded default to
2025-03-01-preview— at
minimum bring the default in line with current Azure OpenAI
Responses API requirements.
Possibly related (different concrete symptoms, same general area):
- BYOK azure provider 404 error #2576 — BYOK azure provider 404 error
- Proposal: External model provider API surface for Copilot CLI (flags/env/config + BYOK) #2710 — Proposal: External model provider API surface for Copilot CLI
- CLI headless mode: internal state accumulation causes progressive latency degradation across sessions #2755 — CLI headless mode: latency degradation under BYOK
Activity
davidatorres commentedon May 8, 2026
Companion issue: #3209 — Hosted-mode autonomous-codegen behavior gap (the related blocker we hit on the same code-agent abstraction effort)
patniko commentedon Oct 26, 2026
Thanks for the report. We've shipped fixes in this area since this was filed (most recently in Copilot CLI v1.0.85), and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.
Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.