feat: migrate azure to v1 api - #3661
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (21)
💤 Files with no reviewable changes (6)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR removes Azure APIVersion from schemas/persistence/UI/tests and unifies all Azure upstream requests to endpoint + /openai/v1/* (including realtime, passthrough, container, streaming, file, and batch endpoints); adds a migration to drop the azure_api_version column and updates docs/tests accordingly. ChangesAzure Provider OpenAI-compatible URL Refactor & APIVersion removal
sequenceDiagram
participant Client
participant Bifrost
participant AzureOpenAI
Client->>Bifrost: Passthrough / requests (may include api-version in RawQuery)
Bifrost->>AzureOpenAI: endpoint + /openai/v1/... (no injected api-version)
AzureOpenAI->>Bifrost: Response
Bifrost->>Client: Forward response
🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
|
tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Confidence Score: 5/5Safe to merge — the URL changes are a straightforward find-and-replace, the DB migration is guarded, and test coverage was updated throughout. The logic changes are mechanical: every endpoint path is updated uniformly, all APIVersion references are removed, and the DB migration correctly checks for column existence before dropping or widening. Both inline findings are formatting/comment issues with no runtime impact. No files require special attention. Important Files Changed
Reviews (7): Last reviewed commit: "feat: migrate azure to v1 api" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/providers/azure/azure.go`:
- Around line 2395-2396: The constructed cancel URL in azure.go (variable
requestURL in the BatchCancel logic) omits the "/v1/" segment; update the
fmt.Sprintf call that builds requestURL (using
key.AzureKeyConfig.Endpoint.GetValue() and request.BatchID) to match the other
batch endpoints (BatchCreate, BatchList, BatchRetrieve) by changing the path
from "/openai/batches/%s/cancel" to "/openai/v1/batches/%s/cancel" so the
endpoint becomes /openai/v1/batches/{id}/cancel.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 93842f5d-0013-4c79-93f3-9369f22b0ca5
📒 Files selected for processing (1)
core/providers/azure/azure.go
f59c88c to
ff463d9
Compare
26be3a7 to
cceaaef
Compare
cceaaef to
71531bb
Compare
3c4a3cf to
cc0efd8
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
framework/configstore/tables/encryption_test.go (1)
1603-1605: ⚡ Quick winReplace the permanent skip with a drop-column assertion.
This removes the only explicit regression coverage for the schema change in this stack. Repurposing the test to assert that
config_keys.azure_api_versionis absent would catch a missed/partial migration instead of silently skipping forever.Suggested replacement
-func TestEncryptedColumns_AzureAPIVersion_FitsAfterWidening(t *testing.T) { - t.Skip("azure_api_version column has been removed from AzureKeyConfig") -} +func TestPostgres_AzureAPIVersionColumnRemoved(t *testing.T) { + db := setupTestPostgresDB(t) + + type countRow struct { + Count int `gorm:"column:count"` + } + + var row countRow + err := db.Raw(` + SELECT COUNT(*) + FROM information_schema.columns + WHERE table_name = 'config_keys' AND column_name = 'azure_api_version'`, + ).Scan(&row).Error + require.NoError(t, err) + assert.Equal(t, 0, row.Count) +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@framework/configstore/tables/encryption_test.go` around lines 1603 - 1605, Replace the permanent skip in TestEncryptedColumns_AzureAPIVersion_FitsAfterWidening: remove t.Skip and instead query the schema to assert that the column config_keys.azure_api_version does not exist (fail the test if it does), using the test harness DB helper used elsewhere in this file (same helpers used by other encryption/schema tests) and report a clear error message; keep the test name and structure but make it an explicit drop-column assertion so a missing migration will fail the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/providers/azure/azure.go`:
- Around line 3703-3710: The current condition only strips the "api-version"
query param for anthropic or a few specific OpenAI v1 endpoints; update the
guard around url.ParseQuery(...) so that any path under "/openai/v1/" is
included (e.g., change the strings.Contains/HasPrefix checks to detect
strings.HasPrefix(path, "/openai/v1/") in addition to "/anthropic/") so
values.Del("api-version") and rawQuery = values.Encode() run for all
"/openai/v1/*" passthrough routes; ensure you keep the existing logic that
parses rawQuery with url.ParseQuery and only modify the path-matching boolean
expression in the same block.
In `@docs/deployment-guides/config-json/providers.mdx`:
- Line 174: The "Multi-region failover" Azure JSON example still contains the
deprecated "api_version" field; remove both occurrences of "api_version" from
that example so it conforms to the Azure v1 model (ensure each key retains the
required "azure_key_config" with "endpoint" and optional "aliases" if needed),
and then validate the updated docs example against transports/config.schema.json
to ensure it passes schema validation after the AzureKeyConfig.APIVersion
removal.
In `@docs/providers/supported-providers/azure.mdx`:
- Around line 15-16: Update the Azure docs so versioning guidance is consistent:
standardize all mentions that currently describe a "preview api-version" to
instead state the v1 contract that uses the "/openai/v1" endpoints with no
"api-version" query parameter required, and keep the note that "Custom
endpoints" allow full control over Azure endpoint configuration; search for and
replace any text that references preview api-version behavior or implies an
api-version query param so it matches the existing lines that say "/openai/v1
with no api-version" and "Custom endpoints - Full control over Azure endpoint
configuration."
In `@framework/configstore/migrations.go`:
- Around line 804-806: The migration fails on fresh DBs because
migrationWidenEncryptedVarcharColumns unconditionally alters
config_keys.azure_api_version before migrationDropAzureAPIVersionColumn is
reached; update migrationWidenEncryptedVarcharColumns to first check whether the
column exists (e.g., query information_schema.columns for table 'config_keys'
and column 'azure_api_version' using ctx/db) and only run the ALTER TABLE ...
ALTER COLUMN azure_api_version TYPE TEXT when that check returns true so the
migration becomes safe/idempotent and won’t fail on fresh installs; keep
references to migrationWidenEncryptedVarcharColumns and
migrationDropAzureAPIVersionColumn when making the change.
---
Nitpick comments:
In `@framework/configstore/tables/encryption_test.go`:
- Around line 1603-1605: Replace the permanent skip in
TestEncryptedColumns_AzureAPIVersion_FitsAfterWidening: remove t.Skip and
instead query the schema to assert that the column config_keys.azure_api_version
does not exist (fail the test if it does), using the test harness DB helper used
elsewhere in this file (same helpers used by other encryption/schema tests) and
report a clear error message; keep the test name and structure but make it an
explicit drop-column assertion so a missing migration will fail the test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 423eaa76-cbbb-4821-97c9-25e768af704c
📒 Files selected for processing (21)
core/internal/llmtests/account.gocore/internal/llmtests/passthrough_api.gocore/providers/azure/azure.gocore/providers/azure/realtime.gocore/providers/azure/types.gocore/schemas/account.godocs/deployment-guides/config-json/providers.mdxdocs/integrations/passthrough.mdxdocs/providers/supported-providers/azure.mdxframework/configstore/clientconfig.goframework/configstore/clientconfig_redaction_test.goframework/configstore/encryption_test.goframework/configstore/migrations.goframework/configstore/rdb.goframework/configstore/tables/encryption_test.goframework/configstore/tables/key.goframework/configstore/tables/virtualkey.gotransports/bifrost-http/handlers/provider_keys.gotransports/bifrost-http/lib/config_test.gotransports/config.schema.jsonui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
💤 Files with no reviewable changes (6)
- core/providers/azure/types.go
- transports/bifrost-http/handlers/provider_keys.go
- framework/configstore/tables/virtualkey.go
- ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
- transports/config.schema.json
- framework/configstore/clientconfig.go
cc0efd8 to
c61e5a2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/internal/llmtests/passthrough_api.go`:
- Around line 69-73: The Azure passthrough helper is building the old deployment
path and query; update the returned passthroughChatReq so its path uses the v1
routing (replace "/openai/deployments/..." with the "/openai/v1/..." equivalent
used by the stack) and set query to an empty string; specifically, change the
fmt.Sprintf path construction in the return that creates passthroughChatReq and
set query: "" so tests validate the new /openai/v1 contract (keep reference to
passthroughChatReq and the fmt.Sprintf call).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8143393-9f91-46e5-9382-a1a1d43fa2c0
📒 Files selected for processing (21)
core/internal/llmtests/account.gocore/internal/llmtests/passthrough_api.gocore/providers/azure/azure.gocore/providers/azure/realtime.gocore/providers/azure/types.gocore/schemas/account.godocs/deployment-guides/config-json/providers.mdxdocs/integrations/passthrough.mdxdocs/providers/supported-providers/azure.mdxframework/configstore/clientconfig.goframework/configstore/clientconfig_redaction_test.goframework/configstore/encryption_test.goframework/configstore/migrations.goframework/configstore/rdb.goframework/configstore/tables/encryption_test.goframework/configstore/tables/key.goframework/configstore/tables/virtualkey.gotransports/bifrost-http/handlers/provider_keys.gotransports/bifrost-http/lib/config_test.gotransports/config.schema.jsonui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
💤 Files with no reviewable changes (6)
- transports/bifrost-http/handlers/provider_keys.go
- framework/configstore/clientconfig.go
- framework/configstore/tables/virtualkey.go
- core/providers/azure/types.go
- transports/config.schema.json
- ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
✅ Files skipped from review due to trivial changes (2)
- docs/integrations/passthrough.mdx
- docs/providers/supported-providers/azure.mdx
The merge-base changed after approval.
c61e5a2 to
c266c33
Compare
Merge activity
|
## Summary
Removes the Azure-specific `api-version` query parameter and deployment-based URL patterns (`/openai/deployments/{model}/...`) from all Azure provider endpoints, replacing them with OpenAI-compatible `/openai/v1/...` paths. This aligns the Azure provider with a unified API routing approach where the endpoint itself is expected to handle versioning.
## Changes
- Replaced all `/openai/deployments/{model}/{operation}?api-version={version}` URL patterns with `/openai/v1/{operation}` across every operation: chat completions, text completions, embeddings, speech, transcription, image generation, image edits, files, batches, responses, and list models.
- Removed all `apiVersion` resolution logic (including fallback to `AzureAPIVersionDefault` and `AzureAPIVersionImageEditDefault`) throughout the provider since the version is no longer appended to URLs.
- Removed the hardcoded `?api-version=preview` suffix from the responses endpoint.
- Updated `buildContainerURL` to drop the `?api-version=` suffix, keeping the `/openai/v1{path}` format.
- The `BatchCancel` URL was also corrected to use the consistent `/openai/v1/batches/{id}/cancel` path.
## Type of change
- [ ] Bug fix
- [ ] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI
## Affected areas
- [ ] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs
## How to test
```sh
go test ./...
```
Validate that requests to each Azure operation (chat, completions, embeddings, speech, transcription, image generation, image edits, files, batches) are routed to the correct `/openai/v1/...` path without any `api-version` query parameter appended.
## Breaking changes
- [x] Yes
- [ ] No
Any Azure deployments relying on the `api-version` query parameter being automatically appended by Bifrost will no longer receive it. The configured Azure endpoint must now handle versioning independently (e.g., via an API gateway or proxy that injects the required `api-version`). The `AzureKeyConfig.APIVersion` field is no longer used by the provider.
## Related issues
## Security considerations
No auth or secrets handling changes. The removal of `api-version` from URLs has no direct security implications, but operators should ensure their Azure endpoint or gateway enforces the correct API version to avoid unintended access to preview or deprecated API surfaces.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features
- **Azure v1 API Migration** — Migrated Azure provider to the v1 API:
removed the `api-version` query parameter and the
`/openai/deployments/{model}/...` URL pattern in favor of
`/openai/v1/{operation}`; the `api_version` field has been dropped from
`AzureKeyConfig` (#3661, #3756)
- **EnvVar Support for OTEL & Prometheus Configs** — `CollectorURL`,
`MetricsEndpoint`, headers, push gateway URL, and basic auth credentials
can now be sourced from environment variables (e.g.,
`env.OTEL_COLLECTOR_URL`); added a new `ConfigMarshallerPlugin`
interface that lets plugins control storage/redaction round-trips
(#3651)
- **OTel Extra Header Forwarding** — `x-bf-eh-*` extra headers forwarded
to upstream providers are now also emitted on the request span under
`gen_ai.request.extra_header.*` for end-to-end tracing (#3730)
- **OTel Semantic Conventions** — Aligned OTel attribute keys with the
OpenTelemetry GenAI spec (canonical `gen_ai.*` and new `bifrost.*`
attributes); legacy attributes are retained in parallel to avoid
breaking existing dashboards (#3732)
- **VK Quota with Provider Configs** — `GetVirtualKeyQuotaByValue` and
the `getVirtualKeyQuota` HTTP response now include `provider_configs`
with their budgets and rate limits (#3721)
- **MCP Temp Token Non-Auth Toggle** — Added
`mcp_enable_temp_token_auth` client config flag to gate short-lived MCP
token minting for non-authenticated users (#3720)
- **Responses Stream in JSON Parser** — `jsonparser` plugin now handles
OpenAI Responses API streaming (`ResponsesStreamRequest`) in addition to
chat completions (#3749)
- **Session API Rework** — Logout now calls both the password-based
session logout and OAuth logout endpoints and resets all RTK Query cache
state (#3698)
## 🐞 Fixed
- **Streaming Latency for Observability** — Deferred root span
termination to the trace completer callback for streaming requests so
request latency is no longer inflated by header-flush time (#3762)
- **Stream Cancellation Race** — Set `BifrostContextKeyConnectionClosed`
before closing the stream and short-circuit `idleTimeoutReader.Read`
when the connection is already closed to avoid panics and hangs on
cancellation (#3733)
- **Bedrock Cache Points** — Strip cache points from Bedrock requests
for models that do not support prompt caching (e.g., GLM, Llama) to
avoid Converse API errors (#3754)
- **Bedrock Empty Text Blocks** — Skip empty/nil text blocks during
Bedrock response conversion to avoid invalid messages (#3747)
- **Bedrock Reasoning + Tools** — Preserve reasoning content blocks on
assistant turns that also contain tool calls in the Bedrock chat
converter (#3690)
- **Bedrock Search Content & Video** — Restored search content and video
parts that were being dropped from Bedrock-native passthrough requests
(#3729)
- **Structured Output Stop Reason** — Fixed an incorrect `tool_calls`
finish reason when structured output is combined with extended-thinking
tools (#3685)
- **Gemini Tool Schema Passthrough** — Forward full tool parameter
schemas via `parametersJsonSchema` instead of the lossy `parameters`
form; corrected tool response role to `user`; resolved structured output
+ tools conflict (#3761)
- **Anthropic Stop Reason & Tool Versions** — Normalized stop reason
mapping (`end_turn` to `stop`, `tool_use` to `tool_calls`, `max_tokens`
to `length`) and upgraded `text_editor_20250124`/`str_replace_editor` to
`text_editor_20250728` for computer-use tools (#3761)
- **Azure Endpoint Redaction** — Fixed a panic when
`AzureKeyConfig.Endpoint` is a literal value rather than an env
reference (#3761)
- **Auth Middleware Path Match** — Match temp-token auth middleware
whitelist against the request path only, not the full URI with query
parameters (#3737)
- **Governance Blocked Models UI** — Restored the missing Blocked Models
create/edit UI in the VK provider config sheet (#3750)
- **Logging Plugin Cleanup Drain** — Fixed a shutdown race where
`batchWriter` could drop in-flight log entries; `Cleanup` now drains
both the recovered batch and remaining queue within a 30-second budget
(#3717)
- **Model Rankings Empty Entries** — Excluded entries with empty `model`
values from model rankings matview queries so blank rows no longer
surface in the UI (#3758)
- **User Filter Duplicates** — Recreated `mv_filter_users` matview to
require non-empty `user_name`, eliminating duplicate filter dropdown
entries (#3764)
- **User Filter Display Name** — Use `user_name` instead of `user_id` as
the display label for users in logging filters (#3691)
- **Large Numeric ID Precision** — Preserve large numeric IDs in URL
search params by skipping JSON parsing for plain strings (#3692)
## 🔧 Refactors & Chores
- **Error Propagation for GetAvailable\* APIs** — `GetAvailable*`
methods on `LoggerPlugin`/`LogManager` now return wrapped errors instead
of silently logging and returning empty slices (#3759)
- **Governance Blocklist Matching** — Use `slices.Contains` for VK
blocked-model matching for clearer code with identical semantics (#3727)
- **Exported `ResolvePeriod`** — Renamed `resolvePeriod` to
`ResolvePeriod` so external packages can reuse the period parsing
(#3763)
## 📚 Docs
- **OTEL Env Var Documentation** — Documented `env.VAR_NAME` support for
`collector_url`, `metrics_endpoint`, and headers in OTEL/Prometheus
plugin docs
- **OTEL OSS Features & Examples** — Added OTEL documentation to the OSS
features list with usage examples (#3731)
- **Anthropic Auth Recommendation** — Recommend `ANTHROPIC_AUTH_TOKEN`
over `ANTHROPIC_CUSTOM_HEADERS` for Claude Code authentication (#3686)
## Summary
This PR releases Bifrost OSS `v1.5.5` and Enterprise `v1.4.4`, bumping all module pins from `v1.5.12`/`v1.3.12` to `v1.5.13`/`v1.3.13` across core, framework, and all plugins. It also hardens the Docker manifest shell scripts, expands CI egress allowlists, and updates documentation to reflect the new SCIM-based user provisioning feature.
## Changes
- **Module version bumps**: All `go.mod`/`go.sum` files updated from `core v1.5.12` → `v1.5.13`, `framework v1.3.12` → `v1.3.13`, and all plugin versions incremented accordingly (`compat`, `governance`, `jsonparser`, `logging`, `maxim`, `mocker`, `otel`, `prompts`, `semanticcache`, `telemetry`).
- **Docker manifest scripts**: Added `#!/usr/bin/env bash` shebang and `set -euo pipefail` to `create-docker-manifest.sh` and `create-docker-manifest-ubi9.sh`; quoted all variable expansions and switched `jq -r` to `jq -er` to fail on null digests.
- **CI egress allowlist**: Added `production.cloudfront.docker.com:443` to Docker-related job allowlists, and added `_https._tcp.dl.google.com:443` and `motd.ubuntu.com:443` to the Ubuntu package job allowlist.
- **Changelog files**: Cleared per-module `changelog.md` files (content moved into the new versioned docs). Added `docs/changelogs/v1.5.5.mdx` and `docs/changelogs/ent-v1.4.4.mdx` with full release notes, and registered both in `docs/docs.json`.
- **Documentation**: Replaced the SSO Integration link with a User Provisioning (SCIM) link in both `README.md` and `transports/README.md`.
- **Enterprise v1.4.4 highlights** (documented): Kafka and Google Cloud Pub/Sub observability sinks, chunked streaming with a 100 MB inter-node message ceiling, BigQuery custom labels via env vars using the new `ConfigMarshallerPlugin` interface, temporary access token expiry extensions, and a multi-node cluster integration harness.
- **OSS v1.5.5 highlights** (documented): Azure v1 API migration, env-var support for OTel/Prometheus configs, OTel extra-header forwarding and semantic-convention alignment, virtual key quota including provider configs, Responses API streaming in `jsonparser`, and a batch of Bedrock, Gemini, Anthropic, Azure, and logging plugin fixes.
## Type of change
- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [x] Documentation
- [x] Chore/CI
## Affected areas
- [x] Core (Go)
- [x] Transports (HTTP)
- [x] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs
## How to test
```sh
# Core/Transports
go version
go test ./...
# Verify Docker manifest scripts exit on error
bash -n .github/workflows/scripts/create-docker-manifest.sh
bash -n .github/workflows/scripts/create-docker-manifest-ubi9.sh
```
Validate that the new changelog pages (`changelogs/v1.5.5` and `changelogs/ent-v1.4.4`) render correctly in the docs site.
## Screenshots/Recordings
N/A
## Breaking changes
- [x] Yes
- [ ] No
The Azure provider no longer accepts `api_version` in `AzureKeyConfig` and has migrated to the `/openai/v1/{operation}` URL pattern. See the [v1.4.0 Migration Guide](https://docs.getbifrost.ai/enterprise/migration-guides/v1.4.0) for full details.
## Related issues
#3661, #3756, #3651, #3730, #3732, #3754, #3747, #3690, #3729, #3685, #3733, #3761, #3735, #3721, #3720, #3749, #3698, #3762, #3750, #3727, #3717, #3759, #3758, #3764, #3691, #3692, #3737, #3763
## Security considerations
- The `ConfigMarshallerPlugin` interface redacts secrets (OTel collector URLs, Prometheus push gateway credentials, BigQuery labels) at config storage time and rehydrates them at load time, preventing plaintext secret persistence.
- Docker manifest scripts now use `set -euo pipefail`, preventing silent failures that could result in malformed or missing image manifests being pushed.
## Checklist
- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
## Summary
Removes the Azure-specific `api-version` query parameter and deployment-based URL patterns (`/openai/deployments/{model}/...`) from all Azure provider endpoints, replacing them with OpenAI-compatible `/openai/v1/...` paths. This aligns the Azure provider with a unified API routing approach where the endpoint itself is expected to handle versioning.
## Changes
- Replaced all `/openai/deployments/{model}/{operation}?api-version={version}` URL patterns with `/openai/v1/{operation}` across every operation: chat completions, text completions, embeddings, speech, transcription, image generation, image edits, files, batches, responses, and list models.
- Removed all `apiVersion` resolution logic (including fallback to `AzureAPIVersionDefault` and `AzureAPIVersionImageEditDefault`) throughout the provider since the version is no longer appended to URLs.
- Removed the hardcoded `?api-version=preview` suffix from the responses endpoint.
- Updated `buildContainerURL` to drop the `?api-version=` suffix, keeping the `/openai/v1{path}` format.
- The `BatchCancel` URL was also corrected to use the consistent `/openai/v1/batches/{id}/cancel` path.
## Type of change
- [ ] Bug fix
- [ ] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI
## Affected areas
- [ ] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs
## How to test
```sh
go test ./...
```
Validate that requests to each Azure operation (chat, completions, embeddings, speech, transcription, image generation, image edits, files, batches) are routed to the correct `/openai/v1/...` path without any `api-version` query parameter appended.
## Breaking changes
- [x] Yes
- [ ] No
Any Azure deployments relying on the `api-version` query parameter being automatically appended by Bifrost will no longer receive it. The configured Azure endpoint must now handle versioning independently (e.g., via an API gateway or proxy that injects the required `api-version`). The `AzureKeyConfig.APIVersion` field is no longer used by the provider.
## Related issues
## Security considerations
No auth or secrets handling changes. The removal of `api-version` from URLs has no direct security implications, but operators should ensure their Azure endpoint or gateway enforces the correct API version to avoid unintended access to preview or deprecated API surfaces.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features
- **Azure v1 API Migration** — Migrated Azure provider to the v1 API:
removed the `api-version` query parameter and the
`/openai/deployments/{model}/...` URL pattern in favor of
`/openai/v1/{operation}`; the `api_version` field has been dropped from
`AzureKeyConfig` (maximhq#3661, maximhq#3756)
- **EnvVar Support for OTEL & Prometheus Configs** — `CollectorURL`,
`MetricsEndpoint`, headers, push gateway URL, and basic auth credentials
can now be sourced from environment variables (e.g.,
`env.OTEL_COLLECTOR_URL`); added a new `ConfigMarshallerPlugin`
interface that lets plugins control storage/redaction round-trips
(maximhq#3651)
- **OTel Extra Header Forwarding** — `x-bf-eh-*` extra headers forwarded
to upstream providers are now also emitted on the request span under
`gen_ai.request.extra_header.*` for end-to-end tracing (maximhq#3730)
- **OTel Semantic Conventions** — Aligned OTel attribute keys with the
OpenTelemetry GenAI spec (canonical `gen_ai.*` and new `bifrost.*`
attributes); legacy attributes are retained in parallel to avoid
breaking existing dashboards (maximhq#3732)
- **VK Quota with Provider Configs** — `GetVirtualKeyQuotaByValue` and
the `getVirtualKeyQuota` HTTP response now include `provider_configs`
with their budgets and rate limits (maximhq#3721)
- **MCP Temp Token Non-Auth Toggle** — Added
`mcp_enable_temp_token_auth` client config flag to gate short-lived MCP
token minting for non-authenticated users (maximhq#3720)
- **Responses Stream in JSON Parser** — `jsonparser` plugin now handles
OpenAI Responses API streaming (`ResponsesStreamRequest`) in addition to
chat completions (maximhq#3749)
- **Session API Rework** — Logout now calls both the password-based
session logout and OAuth logout endpoints and resets all RTK Query cache
state (maximhq#3698)
## 🐞 Fixed
- **Streaming Latency for Observability** — Deferred root span
termination to the trace completer callback for streaming requests so
request latency is no longer inflated by header-flush time (maximhq#3762)
- **Stream Cancellation Race** — Set `BifrostContextKeyConnectionClosed`
before closing the stream and short-circuit `idleTimeoutReader.Read`
when the connection is already closed to avoid panics and hangs on
cancellation (maximhq#3733)
- **Bedrock Cache Points** — Strip cache points from Bedrock requests
for models that do not support prompt caching (e.g., GLM, Llama) to
avoid Converse API errors (maximhq#3754)
- **Bedrock Empty Text Blocks** — Skip empty/nil text blocks during
Bedrock response conversion to avoid invalid messages (maximhq#3747)
- **Bedrock Reasoning + Tools** — Preserve reasoning content blocks on
assistant turns that also contain tool calls in the Bedrock chat
converter (maximhq#3690)
- **Bedrock Search Content & Video** — Restored search content and video
parts that were being dropped from Bedrock-native passthrough requests
(maximhq#3729)
- **Structured Output Stop Reason** — Fixed an incorrect `tool_calls`
finish reason when structured output is combined with extended-thinking
tools (maximhq#3685)
- **Gemini Tool Schema Passthrough** — Forward full tool parameter
schemas via `parametersJsonSchema` instead of the lossy `parameters`
form; corrected tool response role to `user`; resolved structured output
+ tools conflict (maximhq#3761)
- **Anthropic Stop Reason & Tool Versions** — Normalized stop reason
mapping (`end_turn` to `stop`, `tool_use` to `tool_calls`, `max_tokens`
to `length`) and upgraded `text_editor_20250124`/`str_replace_editor` to
`text_editor_20250728` for computer-use tools (maximhq#3761)
- **Azure Endpoint Redaction** — Fixed a panic when
`AzureKeyConfig.Endpoint` is a literal value rather than an env
reference (maximhq#3761)
- **Auth Middleware Path Match** — Match temp-token auth middleware
whitelist against the request path only, not the full URI with query
parameters (maximhq#3737)
- **Governance Blocked Models UI** — Restored the missing Blocked Models
create/edit UI in the VK provider config sheet (maximhq#3750)
- **Logging Plugin Cleanup Drain** — Fixed a shutdown race where
`batchWriter` could drop in-flight log entries; `Cleanup` now drains
both the recovered batch and remaining queue within a 30-second budget
(maximhq#3717)
- **Model Rankings Empty Entries** — Excluded entries with empty `model`
values from model rankings matview queries so blank rows no longer
surface in the UI (maximhq#3758)
- **User Filter Duplicates** — Recreated `mv_filter_users` matview to
require non-empty `user_name`, eliminating duplicate filter dropdown
entries (maximhq#3764)
- **User Filter Display Name** — Use `user_name` instead of `user_id` as
the display label for users in logging filters (maximhq#3691)
- **Large Numeric ID Precision** — Preserve large numeric IDs in URL
search params by skipping JSON parsing for plain strings (maximhq#3692)
## 🔧 Refactors & Chores
- **Error Propagation for GetAvailable\* APIs** — `GetAvailable*`
methods on `LoggerPlugin`/`LogManager` now return wrapped errors instead
of silently logging and returning empty slices (maximhq#3759)
- **Governance Blocklist Matching** — Use `slices.Contains` for VK
blocked-model matching for clearer code with identical semantics (maximhq#3727)
- **Exported `ResolvePeriod`** — Renamed `resolvePeriod` to
`ResolvePeriod` so external packages can reuse the period parsing
(maximhq#3763)
## 📚 Docs
- **OTEL Env Var Documentation** — Documented `env.VAR_NAME` support for
`collector_url`, `metrics_endpoint`, and headers in OTEL/Prometheus
plugin docs
- **OTEL OSS Features & Examples** — Added OTEL documentation to the OSS
features list with usage examples (maximhq#3731)
- **Anthropic Auth Recommendation** — Recommend `ANTHROPIC_AUTH_TOKEN`
over `ANTHROPIC_CUSTOM_HEADERS` for Claude Code authentication (maximhq#3686)
## Summary
Removes the Azure-specific `api-version` query parameter and deployment-based URL patterns (`/openai/deployments/{model}/...`) from all Azure provider endpoints, replacing them with OpenAI-compatible `/openai/v1/...` paths. This aligns the Azure provider with a unified API routing approach where the endpoint itself is expected to handle versioning.
## Changes
- Replaced all `/openai/deployments/{model}/{operation}?api-version={version}` URL patterns with `/openai/v1/{operation}` across every operation: chat completions, text completions, embeddings, speech, transcription, image generation, image edits, files, batches, responses, and list models.
- Removed all `apiVersion` resolution logic (including fallback to `AzureAPIVersionDefault` and `AzureAPIVersionImageEditDefault`) throughout the provider since the version is no longer appended to URLs.
- Removed the hardcoded `?api-version=preview` suffix from the responses endpoint.
- Updated `buildContainerURL` to drop the `?api-version=` suffix, keeping the `/openai/v1{path}` format.
- The `BatchCancel` URL was also corrected to use the consistent `/openai/v1/batches/{id}/cancel` path.
## Type of change
- [ ] Bug fix
- [ ] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI
## Affected areas
- [ ] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs
## How to test
```sh
go test ./...
```
Validate that requests to each Azure operation (chat, completions, embeddings, speech, transcription, image generation, image edits, files, batches) are routed to the correct `/openai/v1/...` path without any `api-version` query parameter appended.
## Breaking changes
- [x] Yes
- [ ] No
Any Azure deployments relying on the `api-version` query parameter being automatically appended by Bifrost will no longer receive it. The configured Azure endpoint must now handle versioning independently (e.g., via an API gateway or proxy that injects the required `api-version`). The `AzureKeyConfig.APIVersion` field is no longer used by the provider.
## Related issues
## Security considerations
No auth or secrets handling changes. The removal of `api-version` from URLs has no direct security implications, but operators should ensure their Azure endpoint or gateway enforces the correct API version to avoid unintended access to preview or deprecated API surfaces.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features
- **Azure v1 API Migration** — Migrated Azure provider to the v1 API:
removed the `api-version` query parameter and the
`/openai/deployments/{model}/...` URL pattern in favor of
`/openai/v1/{operation}`; the `api_version` field has been dropped from
`AzureKeyConfig` (maximhq#3661, maximhq#3756)
- **EnvVar Support for OTEL & Prometheus Configs** — `CollectorURL`,
`MetricsEndpoint`, headers, push gateway URL, and basic auth credentials
can now be sourced from environment variables (e.g.,
`env.OTEL_COLLECTOR_URL`); added a new `ConfigMarshallerPlugin`
interface that lets plugins control storage/redaction round-trips
(maximhq#3651)
- **OTel Extra Header Forwarding** — `x-bf-eh-*` extra headers forwarded
to upstream providers are now also emitted on the request span under
`gen_ai.request.extra_header.*` for end-to-end tracing (maximhq#3730)
- **OTel Semantic Conventions** — Aligned OTel attribute keys with the
OpenTelemetry GenAI spec (canonical `gen_ai.*` and new `bifrost.*`
attributes); legacy attributes are retained in parallel to avoid
breaking existing dashboards (maximhq#3732)
- **VK Quota with Provider Configs** — `GetVirtualKeyQuotaByValue` and
the `getVirtualKeyQuota` HTTP response now include `provider_configs`
with their budgets and rate limits (maximhq#3721)
- **MCP Temp Token Non-Auth Toggle** — Added
`mcp_enable_temp_token_auth` client config flag to gate short-lived MCP
token minting for non-authenticated users (maximhq#3720)
- **Responses Stream in JSON Parser** — `jsonparser` plugin now handles
OpenAI Responses API streaming (`ResponsesStreamRequest`) in addition to
chat completions (maximhq#3749)
- **Session API Rework** — Logout now calls both the password-based
session logout and OAuth logout endpoints and resets all RTK Query cache
state (maximhq#3698)
## 🐞 Fixed
- **Streaming Latency for Observability** — Deferred root span
termination to the trace completer callback for streaming requests so
request latency is no longer inflated by header-flush time (maximhq#3762)
- **Stream Cancellation Race** — Set `BifrostContextKeyConnectionClosed`
before closing the stream and short-circuit `idleTimeoutReader.Read`
when the connection is already closed to avoid panics and hangs on
cancellation (maximhq#3733)
- **Bedrock Cache Points** — Strip cache points from Bedrock requests
for models that do not support prompt caching (e.g., GLM, Llama) to
avoid Converse API errors (maximhq#3754)
- **Bedrock Empty Text Blocks** — Skip empty/nil text blocks during
Bedrock response conversion to avoid invalid messages (maximhq#3747)
- **Bedrock Reasoning + Tools** — Preserve reasoning content blocks on
assistant turns that also contain tool calls in the Bedrock chat
converter (maximhq#3690)
- **Bedrock Search Content & Video** — Restored search content and video
parts that were being dropped from Bedrock-native passthrough requests
(maximhq#3729)
- **Structured Output Stop Reason** — Fixed an incorrect `tool_calls`
finish reason when structured output is combined with extended-thinking
tools (maximhq#3685)
- **Gemini Tool Schema Passthrough** — Forward full tool parameter
schemas via `parametersJsonSchema` instead of the lossy `parameters`
form; corrected tool response role to `user`; resolved structured output
+ tools conflict (maximhq#3761)
- **Anthropic Stop Reason & Tool Versions** — Normalized stop reason
mapping (`end_turn` to `stop`, `tool_use` to `tool_calls`, `max_tokens`
to `length`) and upgraded `text_editor_20250124`/`str_replace_editor` to
`text_editor_20250728` for computer-use tools (maximhq#3761)
- **Azure Endpoint Redaction** — Fixed a panic when
`AzureKeyConfig.Endpoint` is a literal value rather than an env
reference (maximhq#3761)
- **Auth Middleware Path Match** — Match temp-token auth middleware
whitelist against the request path only, not the full URI with query
parameters (maximhq#3737)
- **Governance Blocked Models UI** — Restored the missing Blocked Models
create/edit UI in the VK provider config sheet (maximhq#3750)
- **Logging Plugin Cleanup Drain** — Fixed a shutdown race where
`batchWriter` could drop in-flight log entries; `Cleanup` now drains
both the recovered batch and remaining queue within a 30-second budget
(maximhq#3717)
- **Model Rankings Empty Entries** — Excluded entries with empty `model`
values from model rankings matview queries so blank rows no longer
surface in the UI (maximhq#3758)
- **User Filter Duplicates** — Recreated `mv_filter_users` matview to
require non-empty `user_name`, eliminating duplicate filter dropdown
entries (maximhq#3764)
- **User Filter Display Name** — Use `user_name` instead of `user_id` as
the display label for users in logging filters (maximhq#3691)
- **Large Numeric ID Precision** — Preserve large numeric IDs in URL
search params by skipping JSON parsing for plain strings (maximhq#3692)
## 🔧 Refactors & Chores
- **Error Propagation for GetAvailable\* APIs** — `GetAvailable*`
methods on `LoggerPlugin`/`LogManager` now return wrapped errors instead
of silently logging and returning empty slices (maximhq#3759)
- **Governance Blocklist Matching** — Use `slices.Contains` for VK
blocked-model matching for clearer code with identical semantics (maximhq#3727)
- **Exported `ResolvePeriod`** — Renamed `resolvePeriod` to
`ResolvePeriod` so external packages can reuse the period parsing
(maximhq#3763)
## 📚 Docs
- **OTEL Env Var Documentation** — Documented `env.VAR_NAME` support for
`collector_url`, `metrics_endpoint`, and headers in OTEL/Prometheus
plugin docs
- **OTEL OSS Features & Examples** — Added OTEL documentation to the OSS
features list with usage examples (maximhq#3731)
- **Anthropic Auth Recommendation** — Recommend `ANTHROPIC_AUTH_TOKEN`
over `ANTHROPIC_CUSTOM_HEADERS` for Claude Code authentication (maximhq#3686)

Summary
Removes the Azure-specific
api-versionquery parameter and deployment-based URL patterns (/openai/deployments/{model}/...) from all Azure provider endpoints, replacing them with OpenAI-compatible/openai/v1/...paths. This aligns the Azure provider with a unified API routing approach where the endpoint itself is expected to handle versioning.Changes
/openai/deployments/{model}/{operation}?api-version={version}URL patterns with/openai/v1/{operation}across every operation: chat completions, text completions, embeddings, speech, transcription, image generation, image edits, files, batches, responses, and list models.apiVersionresolution logic (including fallback toAzureAPIVersionDefaultandAzureAPIVersionImageEditDefault) throughout the provider since the version is no longer appended to URLs.?api-version=previewsuffix from the responses endpoint.buildContainerURLto drop the?api-version=suffix, keeping the/openai/v1{path}format.BatchCancelURL was also corrected to use the consistent/openai/v1/batches/{id}/cancelpath.Type of change
Affected areas
How to test
go test ./...Validate that requests to each Azure operation (chat, completions, embeddings, speech, transcription, image generation, image edits, files, batches) are routed to the correct
/openai/v1/...path without anyapi-versionquery parameter appended.Breaking changes
Any Azure deployments relying on the
api-versionquery parameter being automatically appended by Bifrost will no longer receive it. The configured Azure endpoint must now handle versioning independently (e.g., via an API gateway or proxy that injects the requiredapi-version). TheAzureKeyConfig.APIVersionfield is no longer used by the provider.Related issues
Security considerations
No auth or secrets handling changes. The removal of
api-versionfrom URLs has no direct security implications, but operators should ensure their Azure endpoint or gateway enforces the correct API version to avoid unintended access to preview or deprecated API surfaces.Checklist
docs/contributing/README.mdand followed the guidelines