SkillPixel LMS · change walkthrough

SP-746: Tenant-wide AI provider selection

An own-key tenant can now run its AI features on Google Gemini, OpenAI, Anthropic or an OpenAI-compatible gateway, using its own key. Before this, own key meant Gemini only. Managed tenants keep running on the platform Gemini key, and SkillPixel pays. Only a platform admin picks the mode; course content refresh stays Gemini-only.

Status as of 26 Sep 2026

Pull request#473 Merged 25 Sep 2026 (0a0540f0)
Security fixGateway URL and log fix pushed to main (a3cf0bef)
JiraSP-746 Testing
BetaDeployed 25 Sep 2026
ProductionNot released (latest tag v0.0.48)

1How it works

The mode decides whose key is used. The provider decides which AI service is called. Only own key has a provider choice. DOCX / quiz import, the AI tutor, Study Buddy and demo chat all use the tenant's choice. Course refresh is the one exception: it needs Google Search and Gemini image editing, so it stays on Gemini.

SetupWhose key, who paysWhat the admin fills in
ManagedSkillPixel Gemini key, SkillPixel paysNothing
Own key · GeminiTenant key, tenant paysAPI key
Own key · OpenAITenant key, tenant paysAPI key and model
Own key · AnthropicTenant key, tenant paysAPI key and model
Own key · OpenAI-compatibleTenant key, tenant paysAPI key, model and base URL (for example OpenRouter)

No fallback

Own key never falls back to the platform key. A tenant cannot spend SkillPixel's key by accident.

New provider, new key

Changing the provider needs a new key, so an OpenAI key is never sent to Anthropic.

Keys and the mode

Saving or clearing a key never changes the mode, so an own-key tenant with no key stays on own key and its AI features fail. Moving a tenant back to managed deletes its stored key, model and base URL.

Safe gateway URLs

The base URL must be a public https address. Local and private addresses are refused, and redirects are not followed. Provider error text is never written to the logs, so a key echoed by a gateway stays out of them.

Usage and cost

Usage rows record the provider and model. The default OpenAI and Anthropic models are priced (prices checked 23 Sep 2026). Gateway rows show as unpriced.

2What admins see

Local Docker stack built from this branch, 25 Sep 2026. All keys are fake. Desktop width.

Tenant admin: Admin → AI settings

The page has two titled sections. The mode is read-only text. On managed there is no provider form, only a note to contact SkillPixel. On own key the admin picks the provider and sets the key, model and base URL; Save and Remove key sit on one row.

Tenant admin AI settings page on a managed tenant, AI key mode section only
1. Managed tenant: the mode is shown as text with a note to contact SkillPixel. There is no provider form.
Tenant admin AI settings page with OpenAI selected and a saved key
2. Own key on OpenAI: provider, required model and a saved key. Save never changes the mode.
Tenant admin AI settings page with an OpenAI-compatible gateway: key, model and base URL
3. Own key on an OpenAI-compatible gateway (OpenRouter here): the same key and model fields, plus a required Base URL for the endpoint.
Provider changed to Anthropic without a new key, New key required, Save disabled
4. A new provider without a new key: the key shows New key required and Save stays disabled.
Tenant admin remove-key confirm dialog on an own-key tenant
5. Remove key keeps own key mode, so AI features stop until a new key is saved.

Platform admin: tenant card

The key mode comes first, as two options. Managed shows no key inputs: its provider and model are locked to Google Gemini and gemini-3.8-flash until more providers are supported. Own key shows the tenant's provider form. Switching to managed asks to confirm, because SkillPixel then pays and the tenant's key is deleted. A managed tenant with no key switches with Save and switch.

Platform admin AI settings card, tenant on its own OpenAI key
6. A tenant on its own OpenAI key. Click Managed by SkillPixel to switch back.
Platform admin AI settings card, tenant on its own OpenAI-compatible gateway with a base URL
7. A tenant on its own OpenAI-compatible gateway (OpenRouter here). The platform admin sees the same key and model fields, plus the required Base URL.
Platform admin confirm dialog for switching a tenant to the managed key
8. The confirm dialog: SkillPixel's Gemini key will run and pay, and the tenant's stored provider, key and model are deleted.
Platform admin AI settings card in managed mode, provider and model locked, coming soon tooltip
9. The same tenant after the switch. No key inputs; provider and model are locked to Google Gemini and gemini-3.8-flash, with a More providers coming soon tooltip.
Platform admin picks own key for a managed tenant, key form with Save and switch
10. A managed tenant with no key: pick Tenant's own key, fill in the key, then Save and switch. Nothing changes before the save.

3Decisions

  • Two modes stay. Managed is always Gemini; only own key picks a provider.
  • One provider per tenant. There is no choice per feature.
  • Own key never falls back to the platform key.
  • Course refresh stays Gemini-only, with no fallback.
  • Settings go in the existing tenant AI settings, added next to the old fields. No migration, and the previous backend still works after a rollback.
  • Each feature keeps its usage name, so usage reports and PostHog dashboards do not change.
  • A price is added only when it can be checked on the provider's official page.
  • Changing the provider needs a new key.
  • Managed mode is locked to Google Gemini and gemini-3.8-flash in the platform-admin UI for now. More managed providers come later.
Mode is platform-admin only (24 Sep 2026)
  • Managed means SkillPixel pays. A tenant must not move that cost to us on its own.
  • The mode follows the tenant's plan, like other entitlements.
  • Own key without a working key breaks every AI feature, because there is no fallback.

Tenant admins still change their own provider, key and model.

Switching to managed deletes the tenant key (25 Sep 2026)
  • Tenant privacy: SkillPixel keeps no tenant key it no longer uses.
  • The key, provider, model and base URL are deleted in the same write that sets the mode, so they cannot be left behind.
  • Going back to own key later needs the tenant's key again.

This replaces the earlier rule that the key was kept but unused.

4Verification and what is open

  • Backend unit tests: 1758 passed. AI settings DB tests: 135 passed, including a new test that switching to managed deletes every stored credential.
  • Frontend tests: 428 passed. Frontend and platform-admin lint and builds pass.
  • The screens above were checked on a local stack built from 6bd3701c. After switching to managed, the tenant row keeps only gemini_key_mode.

Still open

  • Review and merge PR #473.
  • Tenants that are already managed and still hold an old key keep it until someone clicks Remove key. A one-off cleanup is not decided yet.
  • Check OpenAI, Anthropic and an OpenAI-compatible gateway on beta with real keys. These three are only tested with mocked SDKs so far.
  • A tenant admin who still has the old page open gets a 404 from its mode control (the route is removed) until they reload.