Skip to content

50/50 RevShare Integration: OpenWorker & AIML API - #654

Open
hugoaimlapi wants to merge 2 commits into
andrewyng:mainfrom
aimlapi:feat/aimlapi-provider-upstream
Open

50/50 RevShare Integration: OpenWorker & AIML API#654
hugoaimlapi wants to merge 2 commits into
andrewyng:mainfrom
aimlapi:feat/aimlapi-provider-upstream

Conversation

@hugoaimlapi

Copy link
Copy Markdown

Hi! I'm Hugo from aimlapi.com — an AI aggregator that gives access to 1000+ models in one API, trusted by 400k+ users.

We'd love to be available as a verified provider option inside OpenWorker — so we went ahead and did all the technical work on our side.

To build our partnership, we offer a 50/50 revenue share on all traffic from this integration. (P.S.: tracking starts as soon as this release goes live, so no earnings will be lost during setup)

My contacts: hugo@aimlapi.com (email / Slack), Telegram: @hug0the

Why

The reseller slot in the provider gallery (Together / Fireworks / OpenRouter) exists for exactly this shape — many labs' models behind one key — and aimlapi.com fills it with a plain OpenAI-compatible Chat Completions endpoint, so the descriptor is the existing _compat() four-liner rather than new machinery. Without this, aimlapi.com isn't in the gallery at all: no curated model list, no key Test, no attribution.

Summary

  • registry.py: aimlapi descriptor via the existing _compat() builder — prefilled editable endpoint https://api.aimlapi.com/v1, AIMLAPI_API_KEY env fallback, recommended model zhipu/glm-5.2. App-attribution headers (HTTP-Referer, X-Title, X-AIMLAPI-Partner-ID, X-AIMLAPI-Source) are attached only when the resolved base-URL origin is https://api.aimlapi.com — a key repointed at a corporate proxy or another vendor carries nothing extra, and every other compat vendor's requests stay byte-identical.
  • Key verification: aimlapi.com's /models is public (it answers 200 to a bogus key, an empty key, and no Authorization header), so the generic list-models probe would green-light a typo'd key. The Test button instead sends a one-token chat completion — the cheapest call that actually exercises the credential (401 on a bad key).
  • matrix.py: 4 curated ids in aimlapi.com's OWN namespace (openai/gpt-5.6-sol, anthropic/claude-sonnet-4.6, zhipu/glm-5.2, deepseek/deepseek-v4-pro) — OpenRouter's slugs do not transfer. Each id was checked against the live catalog (2026-09-03) and round-tripped with a real completion whose echoed model came back the same, because an id there can also be an alias of a different model. A new _AGENTIC_VISION_NO_PDF capability row keeps PDFs on the pdf_support.py fallback so no reseller claims native PDF ingestion it hasn't shown. Four rows on purpose — the same budget the other three resellers get.
  • openai_provider.py: opt-in default_headers kwarg — the same knob CodexProvider already uses; the mapping is copied so the shared constant can never be mutated.
  • GUI: gallery tile with aimlapi.com's own brand mark (logos/aimlapi.svg), key-console link (https://aimlapi.com/app/keys), e2e fixture entry.
  • Tests: 13 Python tests across tests/test_providers.py and tests/test_provider_verify.py (descriptor shape, header scoping and immutability, no-attribution for other vendors, no-null params incl. streaming, curated-namespace and routing, verify probe/attribution/override/bad-key); 2 vitest cases in ProviderSetup.test.tsx; 1 Playwright e2e in settings.spec.ts.

How to Test

pytest tests/test_providers.py tests/test_provider_verify.py -q
cd surfaces/gui && npm ci && npx tsc --noEmit && npm test && npm run e2e

Live: Settings ▸ Models ▸ aimlapi.com → paste a key → Test (one-token completion; a wrong key fails instead of green-lighting) → pick zhipu/glm-5.2 and run a task.

Screenshots

Nothing was broken before — this adds a new provider tile (Settings ▸ Models ▸ aimlapi.com: brand mark, prefilled endpoint, key Test). The Playwright e2e in surfaces/gui/e2e/settings.spec.ts covers the new surface; happy to attach app screenshots on request.

Notes

  • Nothing in the agent loop or routing changes; previously saved provider settings load unchanged.
  • Gallery ordering is untouched — aimlapi is appended at the tail of PROVIDER_ORDER and DESCRIPTORS.

Lookoff-AIMLAPI and others added 2 commits September 3, 2026 06:02
The reseller slot in registry.py exists for exactly this shape — many labs'
models behind one key, in the reseller's own id namespace — and aimlapi.com
fills it with a plain Chat Completions endpoint, so the descriptor is the
existing _compat() four-liner rather than new machinery.

Two things it does NOT inherit from the neighbouring rows:

Model ids. OpenRouter's slugs do not transfer: `z-ai/glm-5.2`,
`moonshotai/kimi-k2.6` and `meta-llama/llama-4-maverick` are neither ids nor
aliases there, and llama-4 has no entry at all. Every curated row was taken
from their live catalog and then round-tripped with a real completion, because
an id there can also be an alias of a *different* model — the catalog check
alone can pass while a different model serves the request.

Key verification. Their `/models` is public: it answers 200 to a bogus key, an
empty key, and no Authorization header, so the generic list-models probe behind
the Test button would accept a typo and leave the user to discover it at the
first real turn. Their Test sends a one-token chat completion instead, which is
the cheapest call that actually exercises the credential.

The gateway also reads app-attribution headers, which needed a `default_headers`
kwarg on OpenAIProvider — the same knob CodexProvider already uses. It is opt-in
per descriptor and scoped to aimlapi.com's own ORIGIN rather than to the provider
name, so a key repointed at a proxy or another vendor carries nothing extra.
The placeholder part_openworker was a readable stand-in chosen before the partner was registered. Registration mints the id server-side; this swaps in the real registered value. A wrong or unknown partner id is accepted with a 200 and silently not attributed, so this would not have surfaced at runtime.
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.

2 participants