Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 66 additions & 2 deletions docs-site/src/content/docs/fr/guides/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ registre intégré classe séparément les préréglages locaux ; ceux-ci omette
| --- | --- | --- |
| `key` | Envoie votre clé API (`Authorization: Bearer …`, ou `x-api-key` / `api-key` par adaptateur). La clé peut être un littéral ou une référence `${ENV_VAR}`. | La plupart des fournisseurs. |
| `forward` | Transmet **à l'identique vos en-têtes d'authentification Codex entrants** au fournisseur, sans enregistrer de clé. Il s'agit du transfert de la connexion ChatGPT. | OpenAI (adaptateur `openai-responses`). |
| `oauth` | Résout un jeton d'accès OAuth enregistré — automatiquement actualisé avant son expiration — et l'utilise comme jeton porteur. | xAI, Anthropic, Kimi, Kiro, Google Antigravity, Cursor, Command Code, GitHub Copilot, Nous Portal. |
| `oauth` | Résout un jeton d'accès OAuth enregistré — automatiquement actualisé avant son expiration — et l'utilise comme jeton porteur. | xAI, Anthropic, Kimi, Kiro, Google Antigravity, Gemini, Cursor, Command Code, GitHub Copilot, Nous Portal. |

La relance d'une requête 429 avec la même clé, configurée par
[`retryOn429`](/fr/reference/configuration/), s'applique uniquement aux fournisseurs à clé API
Expand Down Expand Up @@ -94,7 +94,7 @@ Le catalogue du transfert ChatGPT ajoute également les identifiants non qualifi

## 2. Connexion au compte (OAuth)

Huit préréglages de fournisseurs utilisent une connexion OAuth. GitHub Copilot s'y ajoute au moyen d'un pont
Dix préréglages de fournisseurs utilisent une connexion OAuth. GitHub Copilot s'y ajoute au moyen d'un pont
expérimental et non officiel reposant sur un flux d'autorisation d'appareil. opencodex enregistre leurs identifiants dans
`~/.opencodex/auth.json` et les actualise automatiquement. La CLI de connexion accepte également `chatgpt` ;
elle obtient un identifiant ChatGPT tout en créant une entrée de fournisseur en mode `forward`.
Expand All @@ -106,6 +106,8 @@ ocx login kimi # Moonshot Kimi
ocx login nous # Nous Portal (device grant; free + paid models)
ocx login kiro # import kiro-cli credentials (or token fallback)
ocx login google-antigravity
ocx login gemini-cli # OAuth Gemini (compte Google) — sous-type Code Assist
ocx login gemini-ai-studio # OAuth Gemini (compte Google) — sous-type AI Studio
ocx login cursor # standalone Cursor PKCE login
ocx login command-code # Command Code browser OAuth (or import ~/.commandcode/auth.json)
ocx login github-copilot # GitHub device flow → Copilot token (Copilot Pro/Business)
Expand All @@ -121,6 +123,8 @@ ocx logout <provider>
| `nous` | `openai-chat` | `https://inference-api.nousresearch.com/v1` | Passerelle d'abonnement Nous Research (le même service en amont que celui utilisé par Hermes Agent). Connexion par autorisation d'appareil auprès de `portal.nousresearch.com` ; le jeton d'accès est le JWT d'inférence envoyé avec chaque requête. Le catalogue mixte de modèles payants et `:free` (`tencent/hy3:free`, `stepfun/step-3.7-flash:free`, ...) est découvert en direct pour le compte connecté. Les jetons d'actualisation sont à usage unique et renouvelés à chaque actualisation. |
| `kiro` | `kiro` | `https://runtime.us-east-1.kiro.dev` | La connexion initiale importe la session de l'installation locale de `kiro-cli`, déjà authentifiée (sous Unix, installez avec `curl -fsSL https://cli.kiro.dev/install` &#124; `bash`; sous Windows PowerShell, utilisez `irm 'https://cli.kiro.dev/install.ps1'` &#124; `iex`; puis exécutez `kiro-cli login`). **Ajouter un compte** déconnecte `kiro-cli`, lance une nouvelle connexion dans le navigateur qui change le compte utilisé par `kiro-cli`, puis enregistre les métadonnées propres au profil. Les comptes OpenCodex existants sont préservés ; une annulation ou un échec restaure la session `kiro-cli` précédente. |
| `google-antigravity` | `google` | `https://daily-cloudcode-pa.googleapis.com` | Google OAuth avec le protocole Cloud Code Assist. La découverte en direct utilise le point de terminaison CCA authentifié `v1internal:fetchAvailableModels` et publie les modèles d'agent accessibles au compte connecté ; le catalogue maintenu reste la solution de repli. |
| `gemini-cli` | `google` | `https://cloudcode-pa.googleapis.com` | OAuth Gemini (compte Google), sous-type **Code Assist**. Fonctionne avec les forfaits Google One AI Pro/Ultra. Même hôte qu'Antigravity mais une famille de clients différente — voir « Connexion OAuth (Gemini) » ci-dessous. |
| `gemini-ai-studio` | `google` | `https://generativelanguage.googleapis.com` | OAuth Gemini (compte Google), sous-type **AI Studio** : l'API Generative Language avec un jeton bearer au lieu d'une clé API. Nécessite votre propre client OAuth enregistré. |
| `cursor` | `cursor` | `https://api2.cursor.sh` | Connexion PKCE expérimentale, transport HTTP/2 en direct et découverte de modèles filtrés par compte. |
| `github-copilot` | `openai-chat` | `https://api.githubcopilot.com` | Expérimental. Flux d'appareil GitHub et échange `copilot_internal` (client OAuth de VS Code). Nécessite un abonnement Copilot actif ; il ne s'agit pas d'une API tierce officielle. |

Expand All @@ -146,6 +150,66 @@ profil. `chatgpt` n'utilise toujours qu'un seul emplacement, car les comptes du
registre distinct. Les jetons restent dans `~/.opencodex/auth.json` ; `/api/oauth/accounts` ne renvoie que des
métadonnées masquées.

### Connexion OAuth (Gemini)

Autorisez avec un compte Google et choisissez un **sous-type OAuth**. Chaque sous-type est un
fournisseur distinct avec son propre ensemble de comptes, car Google les place derrière des clients
OAuth et des portées différents — un identifiant émis pour l'un n'est pas accepté par l'autre.

| Sous-type | Id du fournisseur | De quoi il s'agit | Quand le choisir |
| --- | --- | --- | --- |
| **Code Assist** | `gemini-cli` | Cloud Code Assist, le backend qu'utilise le Gemini CLI de Google. La connexion découvre (et intègre si nécessaire) un projet Code Assist, ensuite envoyé avec chaque requête. | Par défaut. Un compte Google ordinaire, y compris les forfaits Google One AI Pro / Ultra. |
| **AI Studio** | `gemini-ai-studio` | L'API Generative Language atteinte avec un jeton bearer au lieu d'un `x-goog-api-key`. | Vous avez enregistré votre propre client OAuth Google et préférez OAuth à une clé API. |

**Depuis le tableau de bord.** Ouvrez **Providers → Ajouter un fournisseur → Accounts**. Deux lignes
apparaissent — *Gemini (Code Assist)* et *Gemini (AI Studio)* — chacune étiquetée avec son sous-type.
Cliquez sur celle voulue, complétez l'écran de consentement Google dans le navigateur qui s'ouvre, et
la ligne affiche alors l'adresse e-mail du compte connecté. **Ajouter un compte** sur la même ligne
autorise un second compte Google sans déconnecter le premier.

**Depuis la CLI.**

```bash
ocx login gemini-cli # sous-type Code Assist
ocx login gemini-ai-studio # sous-type AI Studio
ocx logout gemini-cli
```

La connexion ouvre votre navigateur et écoute sur `http://127.0.0.1:51122/callback`. Si le navigateur
ne peut pas joindre l'écouteur en boucle locale, collez l'URL de redirection (ou le `code` seul) dans
l'invite.

**Découverte du projet Code Assist.** Après l'échange du jeton, le sous-type Code Assist appelle
`loadCodeAssist` puis, pour un compte sans projet, `onboardUser`. L'id du projet découvert est
enregistré avec l'identifiant et revérifié à chaque actualisation. Si aucun projet ne peut être
découvert, **la connexion échoue** au lieu d'enregistrer un identifiant dont chaque requête serait
rejetée — le compte apparaîtrait sinon comme « connecté » alors que rien ne fonctionne. Vérifiez que
le compte Google dispose bien de l'accès à Gemini Code Assist, puis réessayez.

**AI Studio exige votre propre client OAuth.** Le client Gemini CLI intégré de Google n'est pas
enregistré pour les portées generative-language ; ce sous-type échoue donc de manière explicite tant
que vous ne fournissez pas les identifiants d'un client issu de votre propre projet Google Cloud
(type de client OAuth *Application de bureau*, avec `http://127.0.0.1:51122/callback` comme URI de
redirection autorisée) :

```bash
export GEMINI_AI_STUDIO_OAUTH_CLIENT_ID="<your-client-id>.apps.googleusercontent.com"
export GEMINI_AI_STUDIO_OAUTH_CLIENT_SECRET="<your-client-secret>"
ocx login gemini-ai-studio
```

Le sous-type Code Assist ne demande aucune configuration : il utilise les identifiants de client
publics que Google distribue dans le Gemini CLI. `GEMINI_CLI_OAUTH_CLIENT_ID` /
`GEMINI_CLI_OAUTH_CLIENT_SECRET` les remplacent si vous préférez votre propre client.

:::caution[Conditions d'utilisation]
Le sous-type Code Assist présente les identifiants du client Gemini CLI propriétaire de Google depuis
un proxy plutôt que depuis la CLI elle-même. Comme les autres passerelles non officielles de cette
page, cela peut entrer en conflit avec les conditions de Google, et la détection d'abus peut
suspendre l'accès. Le sous-type AI Studio ne comporte pas ce risque — il autorise un client que vous
avez enregistré vous-même.
:::

### Importation Cockpit Tools Antigravity

Dans la v1, OpenCodex importe uniquement les exportations JSON **Cockpit Tools Antigravity** destinées au
Expand Down
65 changes: 63 additions & 2 deletions docs-site/src/content/docs/guides/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ labels local presets separately; those normally omit both `authMode` and `apiKey
| --- | --- | --- |
| `key` | Sends your API key (`Authorization: Bearer …`, or `x-api-key` / `api-key` per adapter). The key may be a literal or an `${ENV_VAR}` reference. | Most providers. |
| `forward` | Relays **your incoming Codex auth headers** verbatim to the provider — no key stored. This is the ChatGPT-login passthrough. | OpenAI (`openai-responses` adapter). |
| `oauth` | Resolves a stored OAuth access token (auto-refreshed before expiry) and uses it as the bearer key. | xAI, Anthropic, Kimi, Kiro, Google Antigravity, Cursor, Command Code, GitHub Copilot, Nous Portal. |
| `oauth` | Resolves a stored OAuth access token (auto-refreshed before expiry) and uses it as the bearer key. | xAI, Anthropic, Kimi, Kiro, Google Antigravity, Gemini, Cursor, Command Code, GitHub Copilot, Nous Portal. |
Comment thread
coderabbitai[bot] marked this conversation as resolved.

The [`retryOn429`](/reference/configuration/) same-key 429 replay applies only to API-key
providers (`authMode: "key"`). OAuth, forward, and local presets are excluded — their
Expand Down Expand Up @@ -89,7 +89,7 @@ The ChatGPT passthrough catalog also layers in the bare GPT-5.6 Sol/Terra/Luna s

## 2. Account login (OAuth)

Eight provider presets use OAuth login — plus GitHub Copilot via an experimental unofficial
Ten provider presets use OAuth login — plus GitHub Copilot via an experimental unofficial
device-flow bridge. opencodex stores their credentials in
`~/.opencodex/auth.json` and refreshes them automatically. `chatgpt` is also accepted by the login
CLI; it acquires a ChatGPT credential while creating a `forward`-mode provider entry.
Expand All @@ -101,6 +101,8 @@ ocx login kimi # Moonshot Kimi
ocx login nous # Nous Portal (device grant; free + paid models)
ocx login kiro # import kiro-cli credentials (or token fallback)
ocx login google-antigravity
ocx login gemini-cli # Gemini OAuth (Google account) — Code Assist subtype
ocx login gemini-ai-studio # Gemini OAuth (Google account) — AI Studio subtype
ocx login cursor # standalone Cursor PKCE login
ocx login command-code # Command Code browser OAuth (or import ~/.commandcode/auth.json)
ocx login github-copilot # GitHub device flow → Copilot token (Copilot Pro/Business)
Expand All @@ -116,6 +118,8 @@ ocx logout <provider>
| `nous` | `openai-chat` | `https://inference-api.nousresearch.com/v1` | Nous Research subscription gateway (same backend Hermes Agent uses). Device-grant login against `portal.nousresearch.com`; the access token is the per-request inference JWT. Mixed paid + `:free` model catalog (`tencent/hy3:free`, `stepfun/step-3.7-flash:free`, ...) discovered live from the signed-in account. Refresh tokens are single-use and rotated on every refresh. |
| `kiro` | `kiro` | `https://runtime.us-east-1.kiro.dev` | Initial login imports the installed, signed-in `kiro-cli` session (on Unix, install with `curl -fsSL https://cli.kiro.dev/install` &#124; `bash`; on Windows PowerShell, use `irm 'https://cli.kiro.dev/install.ps1'` &#124; `iex`; then run `kiro-cli login`). **Add account** logs `kiro-cli` out, starts a fresh browser login that switches the account used by `kiro-cli`, and stores account-scoped profile metadata. Existing OpenCodex accounts are preserved, and cancellation or failure restores the previous `kiro-cli` session. |
| `google-antigravity` | `google` | `https://daily-cloudcode-pa.googleapis.com` | Google OAuth over the Cloud Code Assist wire. Live discovery uses CCA's authenticated `v1internal:fetchAvailableModels` endpoint and publishes the agent models available to the signed-in account; the maintained catalog remains the fallback. |
| `gemini-cli` | `google` | `https://cloudcode-pa.googleapis.com` | Gemini OAuth (Google account), **Code Assist** subtype. Works with Google One AI Pro/Ultra plans. Same host as Antigravity but a different client family — see [OAuth login (Gemini)](#oauth-login-gemini). |
| `gemini-ai-studio` | `google` | `https://generativelanguage.googleapis.com` | Gemini OAuth (Google account), **AI Studio** subtype: the Generative Language API with a bearer token instead of an API key. Requires your own registered OAuth client. |
| `cursor` | `cursor` | `https://api2.cursor.sh` | Experimental PKCE login, live HTTP/2 transport with an opt-in HTTP/1.1 compatibility path, and account-filtered model discovery. |
| `github-copilot` | `openai-chat` | `https://api.githubcopilot.com` | Experimental. GitHub device flow + `copilot_internal` exchange (VS Code OAuth client). Requires an active Copilot subscription; not an official third-party API. |

Expand All @@ -140,6 +144,63 @@ distinct one. Kiro accounts are keyed by profile ARN. `chatgpt` is always single
pool accounts have a separate ledger.
Tokens stay in `~/.opencodex/auth.json`; `/api/oauth/accounts` returns masked metadata only.

### OAuth login (Gemini)

Authorize with a Google account and pick an **OAuth subtype**. Each subtype is its own provider
with its own account set, because Google issues the two behind different OAuth clients and scopes —
a credential minted for one is not accepted by the other.

| Subtype | Provider id | What it is | When to pick it |
| --- | --- | --- | --- |
| **Code Assist** | `gemini-cli` | Cloud Code Assist, the backend Google's own Gemini CLI uses. Login discovers (and if needed onboards) a Code Assist project, which is then sent with every request. | Default. A plain Google account, including Google One AI Pro / Ultra plans. |
| **AI Studio** | `gemini-ai-studio` | The Generative Language API reached with a bearer token instead of an `x-goog-api-key`. | You have registered your own Google OAuth client and want OAuth rather than an API key. |

**From the dashboard.** Open **Providers → Add provider → Accounts**. Two rows appear —
*Gemini (Code Assist)* and *Gemini (AI Studio)* — each labelled with its subtype. Click the one you
want, complete the Google consent screen in the browser that opens, and the row switches to the
signed-in account's email. **Add account** on the same row authorizes a second Google account
without logging the first one out.

**From the CLI.**

```bash
ocx login gemini-cli # Code Assist subtype
ocx login gemini-ai-studio # AI Studio subtype
ocx logout gemini-cli
```

Login opens your browser and listens on `http://127.0.0.1:51122/callback`. If the browser cannot
reach the loopback listener, paste the redirect URL (or the bare `code`) back into the prompt.

**Code Assist project discovery.** After the token exchange, the Code Assist subtype calls
`loadCodeAssist` and, for an account with no project yet, `onboardUser`. The discovered project id is
stored with the credential and re-checked on refresh. If no project can be discovered, **the login
fails** rather than saving a credential whose every request would be rejected — the account would
otherwise read as "logged in" while nothing worked. Make sure the Google account actually has Gemini
Code Assist access, then retry.

**AI Studio needs your own OAuth client.** Google's built-in Gemini CLI client is not registered for
the generative-language scopes, so this subtype fails closed with an actionable message until you
supply client credentials from your own Google Cloud project (OAuth client type *Desktop app*, with
`http://127.0.0.1:51122/callback` as an authorized redirect URI):

```bash
export GEMINI_AI_STUDIO_OAUTH_CLIENT_ID="<your-client-id>.apps.googleusercontent.com"
export GEMINI_AI_STUDIO_OAUTH_CLIENT_SECRET="<your-client-secret>"
ocx login gemini-ai-studio
```

The Code Assist subtype needs no configuration: it uses the public client identifiers Google ships
inside the Gemini CLI. `GEMINI_CLI_OAUTH_CLIENT_ID` / `GEMINI_CLI_OAUTH_CLIENT_SECRET` override them
if you would rather use a client of your own.

:::caution[Terms of Service]
The Code Assist subtype presents Google's first-party Gemini CLI client identifiers from a proxy
rather than from the CLI itself. Like the other unofficial bridges here, that may conflict with
Google's terms and abuse detection may suspend access. The AI Studio subtype does not carry this
risk — it authorizes a client you registered yourself.
:::

### Cockpit Tools Antigravity import

For v1, OpenCodex imports only a **Cockpit Tools Antigravity** JSON export for the `google-antigravity` provider. In the Providers dashboard, choose the local JSON file from that provider's Accounts tab. The dashboard does not show the file contents or credential values; it reports only imported, updated, failed, and unsupported counts. Other Cockpit providers are rejected in v1.
Expand Down
Loading
Loading