Skip to content

feat(providers): add AI/ML API as a built-in provider - #8919

Draft
hugoaimlapi wants to merge 27 commits into
lidge-jun:devfrom
aimlapi:feat/aimlapi-provider-refresh-7904
Draft

hugoaimlapi wants to merge 27 commits into
lidge-jun:devfrom
aimlapi:feat/aimlapi-provider-refresh-7904

Conversation

@hugoaimlapi

@hugoaimlapi hugoaimlapi commented Nov 18, 2026 •

Copy link
Copy Markdown

Hi @lidge-jun and @Ingwannu, I’m Hugo, CGO at aimlapi.com. I’m sharing an update on our OpenCodex integration and opening this follow-up to #7904. Thanks for the earlier review.

Summary

  • Add aimlapi as a built-in OpenAI Chat Completions provider at https://api.aimlapi.com/v1. Users can select it in ocx init, run ocx provider add aimlapi, or use the dashboard’s Add provider picker. The preset accepts an API key or the AIMLAPI_API_KEY environment reference.
  • Seed seven chat models, default to openai/gpt-5.6-terra, preserve vendor-prefixed model IDs, and filter the public /v1/models catalog to Chat Completions entries.
  • Bind attribution headers to the preset destination for inference and model discovery. The proposed partner header is still in the draft pending the owner’s keep-or-remove decision.
  • Reapply the change on dev at e7317b6e. Add the provider to the English and Spanish API-key catalogs introduced in #8768 and recount 109 presets, including 88 API-key presets, from the registry.

API operator and open review items

Boiler Labs FZ-LLC operates the AI/ML API service. Section 1 of the Terms of Service identifies Boiler Labs FZ-LLC as the service provider. Section 7 covers API access and usage.

  • Name the person responsible for maintaining the integration.
  • Provide a citable record of upstream routing authorization or record the OpenCodex owner’s decision on the available evidence.
  • Record the OpenCodex owner’s decision on whether to retain or remove X-AIMLAPI-Partner-ID.

Verification

Local testing on macOS arm64 used the repository’s pinned Bun 1.4.4. The published head 61aa8c285 has the same Git tree as the tested local commit 041b1f33.

  • bun run typecheck, bun run structure:check, bun scripts/file-size-ratchet.ts, bun run privacy:scan, bun run skill:surface:check, and git diff --check passed.
  • Focused bun test run across 13 files, covering the preset, routing and discovery, Management API, registry parity, documentation and release checks — 306 passed, 0 failed.
  • Public GET https://api.aimlapi.com/v1/models without credentials listed all seven seeded model IDs as Chat Completions entries.
  • An earlier bun run test:changed on base 819468cf9 reported 57,934 passes, 299 skips, 17 failures, and 3 errors. Re-running the 11 affected files on clean dev at e7317b6e and on the integration yielded the same 370 passes, the same 13 failed tests, and 1 error on each. Live authenticated inference and cross-platform CI remain unverified.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. Maintainer sponsorship and destination review are pending.

Co-authored-by: Stan stan@aimlapi.com
Co-authored-by: Vito Bush 152179873+vito-bush@users.noreply.github.com

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

hugoaimlapi and others added 27 commits November 18, 2026 19:58
Follow up on lidge-jun#7904.

Co-authored-by: Stan <stan@aimlapi.com>
Co-authored-by: Vito Bush <152179873+vito-bush@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the intake: hygiene-blocked Deterministic PR hygiene checks failed label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/oauth/index.ts.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • hygiene: unsponsored_surface.

What to do

  • Fix unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/oauth/index.ts.
  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.
@hugoaimlapi Tick the boxes once required local validation has passed with commands, results, and any full-suite exception documented, your branch is on the latest dev commit, and every correct Codex and CodeRabbit finding is resolved.

@lidge-jun

Copy link
Copy Markdown
Owner

Owner decision, 2026-11-19 (KST), recorded per MAINTAINERS.md ("record the OpenCodex owner's decision on the available evidence").

We are accepting the AI/ML API integration. Concretely:

Accepted

  • aimlapi as a canonical key preset, OpenAI Chat adapter, https://api.aimlapi.com/v1.
  • X-AIMLAPI-Source: agent/opencodex.
  • The withoutRegistryStaticHeaderCopies change: a row retargeted to another origin must not keep carrying preset headers. Reviewed as the security-boundary change this PR triggers (src/oauth/index.ts is a refactor onto the new helper, additions 7 / deletions 5, no auth-path behavior change).
  • Maintenance owner: Hugo (@hugoaimlapi). That closes the "named person, not the in-house team" item.

Not accepted

  • X-AIMLAPI-Partner-ID. A default third-party partner identifier shipped to every user of an MIT client needs a commercial arrangement behind it, and there is none. Drop the header (and the staticHeaders assertion in tests/providers/aimlapi-provider.test.ts that names part_FwTskAwKV3EJU7Du1hqXx75d). If a partner arrangement is wanted, send terms and we will discuss it separately from the preset.

Evidence boundary, stated plainly
The legal entity (Boiler Labs FZ-LLC per ToS §1, with AIMLAPI OÜ as the second entity), the OpenAI-compatible endpoint, and the catalog behavior are covered by Hugo's PR body and re-verified here: an unauthenticated GET https://api.aimlapi.com/v1/models answers 200 to any bearer value (1,519 rows; 360 with type: openai/chat-completions; all seven seeded ids present as of 2026-11-19). Upstream routing/resale authorization is not documented publicly; the owner is accepting the preset on the available evidence and recording that the gap is known rather than closed. This decision is specific to this PR and does not change the evidence bar for other gateway presets.

How it lands
This fork does not allow maintainer edits and the branch is 19 commits behind dev, past the 10-commit readiness bound. We will carry the change on our own branch against current dev with a Co-authored-by: trailer for Hugo and the AI/ML API authors, plus the partner-header removal, and land it through the normal PR path.

@Ingwannu — per the merge policy an outstanding maintainer change request still has to be resolved or explicitly withdrawn before this integrates. The four items from your 2026-10-29 review are addressed as: legal entity cited above, routing authorization recorded as an owner decision rather than a citation, maintenance owner named, partner header dropped.

@lidge-jun

Copy link
Copy Markdown
Owner

Carried here: #8935 (branch codex/aimlapi-preset, based on dev at 0dc315b95, Co-authored-by trailers for Hugo, Stan and Vito). Only delta from this head is the X-AIMLAPI-Partner-ID removal and a docs recount against the current registry. This PR can stay closed or be closed by whoever owns it; the integration is landing through #8935.

lidge-jun added a commit that referenced this pull request Nov 19, 2026
Lands the aimlapi preset from #8919 (Hugo / AI/ML API) on current dev, with
the owner decision recorded on that pull request.

- `aimlapi` key preset: OpenAI Chat adapter at https://api.aimlapi.com/v1,
  seven seeded vendor-prefixed chat ids, live discovery filtered to
  `type: openai/chat-completions` rows of the public catalog, and
  `apiKeyValidation: "unknown"` because that catalog answers 200 to any
  bearer value.
- `X-AIMLAPI-Source: agent/opencodex` attribution on inference and model
  discovery at the preset destination.
- `withoutRegistryStaticHeaderCopies`: a row retargeted to another origin
  must not keep carrying preset headers, on either the inference path
  (`routed-config.ts`) or the discovery path (`oauth/index.ts`).
- Preset totals recounted from the registry: 110 total, 89 key-based,
  across the quickstarts, provider guides and the Spanish catalog copy.

The `X-AIMLAPI-Partner-ID` header the vendor asked for is deliberately
absent. A default third-party partner identifier shipped to every user of an
MIT client needs a commercial arrangement behind it, and there is none
(owner decision, 2026-11-19). The tests assert only the source header is
declared, and the retargeted-row case now exercises an older seeded copy of
that header instead.

Co-authored-by: Hugo <hugo@aimlapi.com>
Co-authored-by: Stan <stan@aimlapi.com>
Co-authored-by: Vito Bush <152179873+vito-bush@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request intake: hygiene-blocked Deterministic PR hygiene checks failed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants