50/50 RevShare Integration: OpenWorker & AIML API - #654
Open
hugoaimlapi wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:aimlapidescriptor via the existing_compat()builder — prefilled editable endpointhttps://api.aimlapi.com/v1,AIMLAPI_API_KEYenv fallback, recommended modelzhipu/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 ishttps://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./modelsis 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 echoedmodelcame back the same, because an id there can also be an alias of a different model. A new_AGENTIC_VISION_NO_PDFcapability row keeps PDFs on thepdf_support.pyfallback 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-indefault_headerskwarg — the same knobCodexProvideralready uses; the mapping is copied so the shared constant can never be mutated.logos/aimlapi.svg), key-console link (https://aimlapi.com/app/keys), e2e fixture entry.tests/test_providers.pyandtests/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 inProviderSetup.test.tsx; 1 Playwright e2e insettings.spec.ts.How to Test
Live: Settings ▸ Models ▸ aimlapi.com → paste a key → Test (one-token completion; a wrong key fails instead of green-lighting) → pick
zhipu/glm-5.2and 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.tscovers the new surface; happy to attach app screenshots on request.Notes
aimlapiis appended at the tail ofPROVIDER_ORDERandDESCRIPTORS.