Skip to content

feat: add OpenCode Go and Grok Supergrok (xAI OAuth) as supported AI providers #3148

Closed

Description

@apoapostolov

Summary

Add OpenCode Go and Grok Supergrok (xAI OAuth) as supported AI providers in Silo's AI Services settings, alongside the existing OpenAI-compatible endpoint and ChatGPT plan options.

Motivation

Silo's AI features (subtitle translation, metadata translation, transcription) currently accept any OpenAI-compatible endpoint via manual base-URL/model/key entry. Users frequently ask for first-class support for popular providers so they don't have to look up endpoints and model names themselves. Two providers in particular are widely used:

  • OpenCode Go — an OpenAI-compatible gateway (endpoint https://opencode.ai/zen/go/v1, default model deepseek-v4-flash). Already integrated elsewhere as a standard API-key provider.
  • Grok Supergrok (xAI OAuth) — xAI's SuperGrok / X Premium+ tier accessed via OAuth device authorization (endpoint https://api.x.ai/v1, default model grok-4.5). This is the same pattern as Silo's existing ChatGPT plan OAuth flow.

Implementation guidance

OpenCode Go (API-key provider, OpenAI-compatible)

This is the simpler of the two. It behaves like any other OpenAI-compatible endpoint — no custom HTTP shape, no OAuth. The work is mostly about making it discoverable:

  1. Default endpoint and model — add a preset or documentation entry:
    • Base URL: https://opencode.ai/zen/go/v1
    • Default model: deepseek-v4-flash
    • Auth: API key (Bearer token)
  2. Hosted-provider detection — add opencode.ai to the KEY_REQUIRED_HOSTS list in web/src/pages/admin-settings/AISettings.tsx so the UI correctly marks a missing key as "API key required" instead of allowing a keyless (and doomed) request.
  3. Transcription presets (optional) — if OpenCode Go offers a Whisper-compatible endpoint, add a preset to TRANSCRIPTION_PRESETS in the same file.
  4. Documentation — list OpenCode Go in the AI provider authentication docs (docs/architecture/ai-provider-authentication.md) as a known compatible provider.

Grok Supergrok / xAI OAuth (OAuth provider, OpenAI-compatible)

This follows the same pattern as Silo's existing ChatGPT plan OAuth flow (auth_mode: "chatgpt"). The xAI OAuth flow uses device authorization (RFC 8628) rather than the browser redirect flow that OpenAI uses, but the Silo-side integration shape is identical: an auth_mode value, a connection dialog, token storage, and model catalog fetching.

  1. Auth mode — add "xai-oauth" (or "supergrok") as a new auth_mode value alongside "api_key" and "chatgpt" in the settings form and the ai.auth_mode setting.
  2. OAuth device flow — implement an xAI device-authorization flow analogous to the ChatGPT sign-in attempt flow:
    • POST https://api.x.ai/v1/oauth/device/code to get a device code + user code
    • Poll POST https://api.x.ai/v1/oauth/token until the user completes authorization
    • Store access token + refresh token + expiry, same as ChatGPT registration
  3. Token refresh — implement refresh-token rotation before expiry, same as the ChatGPT refresh path.
  4. Model catalog — fetch available models from GET https://api.x.ai/v1/models, filtered to grok* chat models (exclude image/video/voice variants).
  5. Endpoint — base URL https://api.x.ai/v1, default model grok-4.5.
  6. Recommended-family pairing — pair xai (API-key) and xai-oauth (SuperGrok) as recommended siblings, so a recommended model name copies across.
  7. UI — add a SuperGrok connection tile in AISettings.tsx analogous to ChatGPTConnection, showing connection status, model picker, and disconnect.
  8. Reasoning effort — xAI Grok models support reasoning; wire into the existing reasoning-effort selector.
  9. Documentation — document the xAI OAuth flow in docs/architecture/ai-provider-authentication.md.

Shared considerations

  • Both providers are OpenAI-compatible on the chat completions path, so no changes are needed in internal/ai/llm/client.go beyond possibly adding host entries to strictHostedASRHosts in transcribe.go if they offer transcription.
  • The reasoning.Validate / reasoning.OmitTemperature functions in internal/ai/reasoning/reasoning.go may need entries for new model families (Grok, DeepSeek via OpenCode Go).
  • No database migration is strictly required if providers are configured via the existing ai.* settings keys, but adding preset defaults would improve UX.

References

  • Silo's existing ChatGPT OAuth — internal/ai/chatgpt/ package and web/src/pages/admin-settings/ChatGPTConnection.tsx as the template for the SuperGrok connection UI.
  • xAI API documentation for device authorization flow and model listing.
  • OpenCode Go API documentation for endpoint and model details.

Acceptance criteria

  • OpenCode Go appears as a selectable preset (or is documented as a known-compatible provider) in AI Services settings, with correct default endpoint and model.
  • Grok Supergrok can be connected via OAuth device flow, with model selection and token refresh.
  • Both providers work for subtitle translation, metadata translation, and (where applicable) transcription.
  • Documentation updated to list both providers.

Activity

  1. added
    enhancement
    feature-request
    priority: P2
    on Oct 27, 2026
  2. added 3 commits that reference this issue on Oct 27, 2026
    2ee5943
    b31fe8c
    1ca8215
  3. locked and limited conversation to collaborators on Nov 9, 2026
  4. converted this issue into a discussion #3811 on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeature-requestpriority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions