|
| 1 | +# Model provider OAuth |
| 2 | + |
| 3 | +OpenBot's Google and xAI model connections are separate from signing in to |
| 4 | +OpenBot or CopilotKit. API keys remain available for both providers. |
| 5 | + |
| 6 | +## Google Gemini |
| 7 | + |
| 8 | +Google OAuth uses the Gemini Developer API and the selected Google Cloud |
| 9 | +project's API quota. It does not use a personal Gemini subscription. OAuth |
| 10 | +requests use Google's native generation API; the local server translates the |
| 11 | +existing agents' Chat Completions requests, streamed replies, tool calls and |
| 12 | +screenshots. API-key connections continue to use Google's compatibility API. |
| 13 | + |
| 14 | +Before distributing a configured desktop build, register a **Desktop app** OAuth |
| 15 | +client in a Google Cloud project with the Generative Language API enabled. Set |
| 16 | +these variables when building the desktop app to include its defaults. Runtime |
| 17 | +process environment variables can override those defaults: |
| 18 | + |
| 19 | +- `OPENBOT_GOOGLE_MODEL_OAUTH_CLIENT_ID`: that desktop client's ID. |
| 20 | +- `OPENBOT_GOOGLE_MODEL_OAUTH_CLIENT_SECRET`: the client secret, when issued. |
| 21 | +- `OPENBOT_GOOGLE_MODEL_OAUTH_QUOTA_PROJECT`: the project that supplies API quota. |
| 22 | + |
| 23 | +For GitHub-built artifacts, configure repository Actions **variables** named |
| 24 | +`OPENBOT_GOOGLE_MODEL_OAUTH_CLIENT_ID` and |
| 25 | +`OPENBOT_GOOGLE_MODEL_OAUTH_QUOTA_PROJECT`, plus an Actions **secret** named |
| 26 | +`OPENBOT_GOOGLE_MODEL_OAUTH_CLIENT_SECRET` when the client has one. Both the |
| 27 | +Desktop artifact workflow and the Windows signing workflow pass these settings |
| 28 | +to the native build. They become defaults inside the distributed desktop app; |
| 29 | +the desktop client credential is not a user access or refresh token. |
| 30 | + |
| 31 | +When calling the Desktop workflow as a reusable workflow, pass its optional |
| 32 | +`OPENBOT_GOOGLE_MODEL_OAUTH_CLIENT_SECRET` secret explicitly or use |
| 33 | +`secrets: inherit`. GitHub does not provide repository secrets to fork pull |
| 34 | +requests. Missing settings do not fail the build; API-key connections remain |
| 35 | +available, and Google sign-in requires a configured build or runtime settings. |
| 36 | + |
| 37 | +Do not reuse OpenBot's web SSO credentials (`GOOGLE_OAUTH_CLIENT_ID` and |
| 38 | +`GOOGLE_OAUTH_CLIENT_SECRET`): their callback and permissions serve a different |
| 39 | +purpose. Configure the consent screen and test users, and complete Google's |
| 40 | +verification requirements before wider distribution. |
| 41 | + |
| 42 | +References: [Gemini API OAuth](https://ai.google.dev/gemini-api/docs/oauth) and |
| 43 | +[Google desktop OAuth](https://developers.google.com/identity/protocols/oauth2/native-app). |
| 44 | + |
| 45 | +## xAI |
| 46 | + |
| 47 | +xAI sign-in uses device authorization: OpenBot opens the provider's verification |
| 48 | +page, the user approves the displayed code, and OpenBot receives refreshable |
| 49 | +credentials. API calls use `https://api.x.ai/v1`. |
| 50 | + |
| 51 | +The integration follows the public OAuth flow in xAI's endorsed OpenCode |
| 52 | +integration. A distributor can set `OPENBOT_XAI_MODEL_OAUTH_CLIENT_ID` to an |
| 53 | +alternative registered client. Account entitlements and provider limits still |
| 54 | +apply. |
| 55 | + |
| 56 | +References: [xAI's OpenCode integration](https://x.ai/news/grok-opencode) and |
| 57 | +[xAI OAuth discovery](https://auth.x.ai/.well-known/openid-configuration). |
| 58 | + |
| 59 | +## Credential lifecycle |
| 60 | + |
| 61 | +The desktop's provider credentials remain in its local deployment; React does |
| 62 | +not receive access or refresh tokens. The local server refreshes credentials |
| 63 | +before model calls and saves rotated tokens. Agent processes receive a local |
| 64 | +proxy credential instead of the provider's refresh token. Provider revocation |
| 65 | +requires signing in again. |
| 66 | + |
| 67 | +Do not commit deployment credential files or include their contents in support |
| 68 | +reports. OAuth validation must include a real model call, refresh and restart, |
| 69 | +and a Bot using its browser tool and rendering a graphical component. |
0 commit comments