Skip to content

feat: migrate azure to v1 api - #3661

Merged
akshaydeo merged 1 commit into
devfrom
05-19-feat_migrate_azure_to_v1_api
May 26, 2026
Merged

feat: migrate azure to v1 api#3661
akshaydeo merged 1 commit into
devfrom
05-19-feat_migrate_azure_to_v1_api

Conversation

@TejasGhatte

@TejasGhatte TejasGhatte commented May 21, 2026

Copy link
Copy Markdown
Collaborator

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
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

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 any api-version query parameter appended.

Breaking changes

  • 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

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 45f17247-9121-47a0-808e-ee72de817f3a

📥 Commits

Reviewing files that changed from the base of the PR and between c61e5a2 and c266c33.

📒 Files selected for processing (21)
  • core/internal/llmtests/account.go
  • core/internal/llmtests/passthrough_api.go
  • core/providers/azure/azure.go
  • core/providers/azure/realtime.go
  • core/providers/azure/types.go
  • core/schemas/account.go
  • docs/deployment-guides/config-json/providers.mdx
  • docs/integrations/passthrough.mdx
  • docs/providers/supported-providers/azure.mdx
  • framework/configstore/clientconfig.go
  • framework/configstore/clientconfig_redaction_test.go
  • framework/configstore/encryption_test.go
  • framework/configstore/migrations.go
  • framework/configstore/rdb.go
  • framework/configstore/tables/encryption_test.go
  • framework/configstore/tables/key.go
  • framework/configstore/tables/virtualkey.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config_test.go
  • transports/config.schema.json
  • ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
💤 Files with no reviewable changes (6)
  • transports/bifrost-http/handlers/provider_keys.go
  • core/providers/azure/types.go
  • framework/configstore/clientconfig.go
  • transports/config.schema.json
  • framework/configstore/tables/virtualkey.go
  • ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
✅ Files skipped from review due to trivial changes (2)
  • docs/integrations/passthrough.mdx
  • docs/deployment-guides/config-json/providers.mdx

📝 Walkthrough

Summary by CodeRabbit

  • Refactor

    • Azure integration now routes to OpenAI-compatible v1 endpoints for all operations (chat, completions, responses, streaming, embeddings, images, audio, files and realtime); container and passthrough URLs no longer inject an api-version.
  • Chores

    • Removed Azure "API Version" field from UI, JSON schema, persistence, redaction, and tests; DB migrations drop the column.
  • Documentation

    • Docs updated to reflect v1 endpoints and passthrough api-version behavior.

Walkthrough

The 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.

Changes

Azure Provider OpenAI-compatible URL Refactor & APIVersion removal

Layer / File(s) Summary
Core URL builders & passthrough normalization
core/providers/azure/azure.go, core/providers/azure/azure.go:buildPassthroughURL, core/providers/azure/azure.go:buildContainerURL
completeRequest, passthrough and container builders now construct endpoint + "/openai/v1/...", normalize SDK paths (e.g., /openai/responses → /openai/v1/responses), and strip/carry caller rawQuery as appropriate; ContainerFileList fixes query concatenation.
Models listing
core/providers/azure/azure.go
Model listing now requests endpoint/openai/v1/models without deriving api-version.
Completions, Chat, Responses (incl. streaming)
core/providers/azure/azure.go
Text completions/stream, chat completion/stream, and responses/stream endpoints now target openai/v1/completions, openai/v1/chat/completions, and openai/v1/responses with api-version removed.
Embeddings, Speech, Transcription
core/providers/azure/azure.go
Embeddings, audio speech (streaming and non-streaming), and transcription endpoints use openai/v1/embeddings and openai/v1/audio/* paths without api-version.
Image generation & edits
core/providers/azure/azure.go
Image generation, streaming, and edit endpoints moved to openai/v1/images/generations and openai/v1/images/edits, removing deployments + api-version logic.
File operations
core/providers/azure/azure.go
File upload, list, retrieve, delete, and content endpoints use openai/v1/files and openai/v1/files/{id}; pagination/filter params preserved, api-version removed.
Batch operations
core/providers/azure/azure.go
Batch create/list/retrieve/cancel use openai/v1/batches and openai/v1/batches/{id} paths without api-version queries.
Realtime endpoints
core/providers/azure/realtime.go
Realtime WebSocket URL, WebRTC SDP exchange, and realtime client secret creation target /openai/v1/realtime/... and no longer use per-key/api-version selection; helper removed.
Passthrough tests
core/internal/llmtests/passthrough_api.go
Passthrough helper now returns an explicit RawQuery (api-version) for Azure test cases and test runner includes RawQuery in passthrough request payloads.
Schemas, types, UI, docs
core/schemas/account.go, core/providers/azure/types.go, transports/config.schema.json, ui/app/.../apiKeysFormFragment.tsx, docs/*
Removed AzureKeyConfig.APIVersion and Azure APIVersion constants; removed azure_key_config.api_version from JSON schema and UI forms; updated docs to reference /openai/v1/ usage only.
Configstore persistence & migrations
framework/configstore/*, framework/configstore/tables/*
Stop persisting azure_api_version in TableKey and RDB flows, remove encryption/decryption/reconstruction, and add migration to drop config_keys.azure_api_version.
Redaction & merge behavior
framework/configstore/clientconfig.go, transports/bifrost-http/handlers/provider_keys.go
Redaction no longer preserves APIVersion; merge logic for redacted APIVersion removed.
Tests updated
framework/configstore/*, framework/configstore/tables/*, transports/bifrost-http/lib/config_test.go, core/internal/llmtests/*
Many tests updated or removed to omit APIVersion from fixtures and assertions (encryption, table-key tests, hashing/reconciliation, redaction, and passthrough tests).
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
Loading

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers:

  • akshaydeo
  • danpiths
  • roroghost17

"I hopped across URLs, tidy and spry,
Snipped api-versions saying goodbye,
OpenAI paths now clean as a flute,
Passthroughs keep queries resolute,
Migration cleared the old column sky." 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: migrate azure to v1 api' clearly and concisely summarizes the main refactoring work—migrating all Azure OpenAI endpoints from deployment-based routing with api-version parameters to OpenAI-compatible /openai/v1 paths.
Description check ✅ Passed The description comprehensively covers all required sections: Summary explains the core purpose, Changes detail specific modifications with rationale, Type and Affected areas are clearly marked, How to test provides validation steps, Breaking changes are acknowledged with migration guidance, and Security considerations address relevant concerns.
Docstring Coverage ✅ Passed Docstring coverage is 84.38% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-19-feat_migrate_azure_to_v1_api

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 @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

TejasGhatte commented May 21, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@TejasGhatte
TejasGhatte marked this pull request as ready for review May 21, 2026 12:40
@greptile-apps

greptile-apps Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe 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

Filename Overview
core/providers/azure/azure.go All structured operation URLs migrated from deployment-based paths with api-version to /openai/v1/{operation}; buildPassthroughURL simplified to forward query params as-is (stripping api-version only for responses/videos/anthropic routes); ContainerFileList ? vs & fixed correctly.
core/providers/azure/realtime.go Removed azureRealtimeAPIVersion helper and api-version parameter from WebSocket URL, WebRTC SDP, and client secret endpoints; straightforward removal with no logic changes.
framework/configstore/migrations.go Adds migrationDropAzureAPIVersionColumn to drop the column from config_keys; also guards the widen-varchar migration for azure_api_version with a HasColumn check. Function has a copy-pasted doc comment from the preceding migration.
framework/configstore/rdb.go Removes AzureAPIVersion assignments across tableKeyFromSchemaKey, UpdateProvidersConfig, UpdateProvider, and AddProvider; closing brace of the if-block in UpdateProvidersConfig is over-indented (gofmt failure).
core/providers/azure/types.go Removes AzureAPIVersionDefault, AzureAPIVersionPreview, and AzureAPIVersionImageEditDefault constants; only AzureAnthropicAPIVersionDefault remains.
core/schemas/account.go Removes APIVersion field from AzureKeyConfig struct; breaking schema change that aligns the struct with the v1 API approach.
framework/configstore/tables/key.go Removes AzureAPIVersion column field, its BeforeSave encryption, AfterFind decryption, and reconstruction logic; AfterFind condition updated to no longer check AzureAPIVersion for config reconstruction.
core/internal/llmtests/passthrough_api.go Updates Azure passthrough test to explicitly supply api-version in RawQuery instead of relying on automatic injection; consistent with the new passthrough behaviour.

Reviews (7): Last reviewed commit: "feat: migrate azure to v1 api" | Re-trigger Greptile

Comment thread core/providers/azure/azure.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b287d55 and 26be3a7.

📒 Files selected for processing (1)
  • core/providers/azure/azure.go

Comment thread core/providers/azure/azure.go Outdated
@akshaydeo
akshaydeo force-pushed the dev branch 2 times, most recently from f59c88c to ff463d9 Compare May 22, 2026 15:16
@TejasGhatte
TejasGhatte force-pushed the 05-19-feat_migrate_azure_to_v1_api branch from 26be3a7 to cceaaef Compare May 25, 2026 03:22
@coderabbitai
coderabbitai Bot requested review from akshaydeo and danpiths May 25, 2026 03:24
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 25, 2026
@TejasGhatte
TejasGhatte force-pushed the 05-19-feat_migrate_azure_to_v1_api branch from cceaaef to 71531bb Compare May 25, 2026 03:51
@coderabbitai
coderabbitai Bot requested a review from roroghost17 May 25, 2026 03:53
@TejasGhatte
TejasGhatte force-pushed the 05-19-feat_migrate_azure_to_v1_api branch 2 times, most recently from 3c4a3cf to cc0efd8 Compare May 25, 2026 05:39

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
framework/configstore/tables/encryption_test.go (1)

1603-1605: ⚡ Quick win

Replace 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_version is 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

📥 Commits

Reviewing files that changed from the base of the PR and between ff463d9 and cc0efd8.

📒 Files selected for processing (21)
  • core/internal/llmtests/account.go
  • core/internal/llmtests/passthrough_api.go
  • core/providers/azure/azure.go
  • core/providers/azure/realtime.go
  • core/providers/azure/types.go
  • core/schemas/account.go
  • docs/deployment-guides/config-json/providers.mdx
  • docs/integrations/passthrough.mdx
  • docs/providers/supported-providers/azure.mdx
  • framework/configstore/clientconfig.go
  • framework/configstore/clientconfig_redaction_test.go
  • framework/configstore/encryption_test.go
  • framework/configstore/migrations.go
  • framework/configstore/rdb.go
  • framework/configstore/tables/encryption_test.go
  • framework/configstore/tables/key.go
  • framework/configstore/tables/virtualkey.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config_test.go
  • transports/config.schema.json
  • ui/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

Comment thread core/providers/azure/azure.go
Comment thread docs/deployment-guides/config-json/providers.mdx
Comment thread docs/providers/supported-providers/azure.mdx
Comment thread framework/configstore/migrations.go
@TejasGhatte
TejasGhatte force-pushed the 05-19-feat_migrate_azure_to_v1_api branch from cc0efd8 to c61e5a2 Compare May 25, 2026 06:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between cc0efd8 and c61e5a2.

📒 Files selected for processing (21)
  • core/internal/llmtests/account.go
  • core/internal/llmtests/passthrough_api.go
  • core/providers/azure/azure.go
  • core/providers/azure/realtime.go
  • core/providers/azure/types.go
  • core/schemas/account.go
  • docs/deployment-guides/config-json/providers.mdx
  • docs/integrations/passthrough.mdx
  • docs/providers/supported-providers/azure.mdx
  • framework/configstore/clientconfig.go
  • framework/configstore/clientconfig_redaction_test.go
  • framework/configstore/encryption_test.go
  • framework/configstore/migrations.go
  • framework/configstore/rdb.go
  • framework/configstore/tables/encryption_test.go
  • framework/configstore/tables/key.go
  • framework/configstore/tables/virtualkey.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config_test.go
  • transports/config.schema.json
  • ui/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

Comment thread core/internal/llmtests/passthrough_api.go
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 25, 2026
@akshaydeo
akshaydeo dismissed coderabbitai[bot]’s stale review May 25, 2026 08:23

The merge-base changed after approval.

@TejasGhatte
TejasGhatte force-pushed the 05-19-feat_migrate_azure_to_v1_api branch from c61e5a2 to c266c33 Compare May 25, 2026 08:46

akshaydeo commented May 26, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • May 26, 8:56 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 26, 8:57 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit 90487f6 into dev May 26, 2026
14 of 15 checks passed
@akshaydeo
akshaydeo deleted the 05-19-feat_migrate_azure_to_v1_api branch May 26, 2026 08:57
akshaydeo pushed a commit that referenced this pull request May 26, 2026
## 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
@akshaydeo akshaydeo mentioned this pull request May 26, 2026
akshaydeo added a commit that referenced this pull request May 26, 2026
## ✨ 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)
@akshaydeo akshaydeo mentioned this pull request May 27, 2026
18 tasks
akshaydeo added a commit that referenced this pull request May 27, 2026
## 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
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## 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
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## ✨ 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)
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## 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
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## ✨ 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants