Skip to content

feat: add API Route as an OpenAI-compatible provider alias - #4567

Merged
aheritier merged 2 commits into
docker:mainfrom
DennyHo0917:feat/api-route-provider
Oct 15, 2026
Merged

aheritier merged 2 commits into
docker:mainfrom
DennyHo0917:feat/api-route-provider

Conversation

@DennyHo0917

@DennyHo0917 DennyHo0917 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add API Route as an opt-in OpenAI-compatible alias, following the Atlas Cloud (#3962) and DaoXE (#4246) patterns.

  • Register api-route with https://global.api-route.com/v1 and API_ROUTE_API_KEY.
  • Support automatic credential discovery/forwarding with gpt-6.1-sol as the default model.
  • Reuse the existing Chat Completions transport and consecutive-system-message handling.
  • Add a provider guide, navigation/table/schema entries, and a runnable code-assistant example.
  • Extend existing alias, auto-selection, system-message and hermetic/live transport tests.

API Route is absent from the embedded models.dev snapshot. The existing catalog-exemption mechanism is used without editing the generated snapshot. The guide explains the missing metadata and conservative attachment handling; no pricing, context-window or multimodal claims are added.

Validation

  • Windows build using the project's scripts/build.sh: passed.
  • Config/provider package tests: passed with the local HTTP proxy removed for the SSRF-address test.
  • Real request through TestOpenAIAliasProvider_LiveAPI/api-route: passed, streamed pong using gpt-6.1-sol.
  • Authenticated GET /v1/models: 57 IDs, including the exact default ID.
  • Real Chat Completions tool call: add with arguments {"a":2,"b":3}, finish_reason: tool_calls.
  • git diff --check: passed. Commit carries DCO sign-off and a GitHub-verified SSH signature.

go mod tidy --diff passed with no dependency changes. The full Windows suite did not pass in this environment: failures include HTTP-proxy interference with SSRF tests, unavailable symlink privileges/native tooling, and Windows path/Unix-fixture assumptions. The proxy-sensitive config failure and the reasoning-block path failure also reproduce on the unmodified base; all config/provider package tests pass after removing the proxy variables for that process. No claim of a full-suite pass is made.

Native golangci-lint reports four findings in unchanged Windows-only tests (pkg/sandbox/options_windows_test.go, pkg/hooks/helpers_windows_test.go); running the same linter on the unmodified base produces the identical four findings. Project cops report 23 Lint/OTelTracerName findings in unchanged source, comparing Windows backslashes in package paths against standard slash-separated import paths. These local platform limitations remain for upstream CI/maintainer verification.

Disclosure: I am affiliated with API Route. This contribution was prepared with AI assistance and reviewed before submission.

Signed-off-by: dennyho0917 <dennyho0917@gmail.com>
@aheritier aheritier added area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/providers/openai For features/issues/fixes related to the usage of OpenAI models kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Oct 11, 2026
@DennyHo0917
DennyHo0917 marked this pull request as ready for review October 12, 2026 11:53
@DennyHo0917
DennyHo0917 requested a review from a team as a code owner October 12, 2026 11:53

@aheritier aheritier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated implementer agent — this comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer

Requesting changes for one medium test-safety issue: this new API Route test row enables real inference during ordinary test runs when its credential is exported. Please add a separate explicit live-test opt-in, at least for the new provider live subtest, keep mock tests unconditional, and add a regression proving that the credential alone does not enable live inference. The inline finding has the details; no production-provider wiring or default-model validity issue is asserted.

Comment thread pkg/model/provider/openai_alias_providers_test.go
@aheritier
aheritier marked this pull request as draft October 14, 2026 09:33
Signed-off-by: dennyho0917 <dennyho0917@gmail.com>
@DennyHo0917
DennyHo0917 marked this pull request as ready for review October 14, 2026 11:20
@aheritier aheritier self-assigned this Oct 15, 2026
@aheritier
aheritier enabled auto-merge October 15, 2026 13:35
@aheritier
aheritier added this pull request to the merge queue Oct 15, 2026
Merged via the queue into docker:main with commit d32e27a Oct 15, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/providers/openai For features/issues/fixes related to the usage of OpenAI models kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants