# OpenAI API key (/docs/providers/openai-key)

The OpenAI API key account answers with a key from OpenAI. The wallet lists it as OpenAI under "With an API key", with the id `openai-key`. A ChatGPT subscription is a separate account, described on the [ChatGPT plan](/docs/providers/chatgpt) page.

## What the visitor needs [#what-the-visitor-needs]

An OpenAI API key. OpenAI bills the account that owns the key.

## Connect [#connect]

1. The visitor creates an API key in OpenAI's console, on the account that should pay.
2. In the wallet, the visitor picks OpenAI under "With an API key".
3. The visitor pastes the key in the "OpenAI API key" field and presses Connect.

The wallet keeps the key in its encrypted vault, without the spaces around it. It makes no test call, and a wrong key shows up as the provider's error on the first answer. The key has no expiry in the wallet and stays in the vault until the visitor removes the account.

## Models [#models]

The wallet lists the models of `https://api.openai.com/v1/models` whose id starts with `gpt`, `chatgpt`, or `o` followed by a digit, newest first. The wallet leaves out the ids that name another kind of model: those containing `embed`, `audio`, `realtime`, `transcribe`, `tts`, `image`, `dall`, `whisper`, `moderation`, `search`, `ocr` or `codex`. It keeps the list for a day. The visitor picks the account's default model in its settings, and a model per site with the buttons of the side panel. Without a choice, the account answers with `gpt-6-luna`.

## Usage and limits [#usage-and-limits]

The wallet reads `x-ratelimit-remaining-tokens` and `x-ratelimit-limit-tokens` on each answer that carries them. The room left is the remaining tokens divided by the limit. Without these headers, the card keeps saying "Usage shows after the first answer", and Auto ranks the account among the accounts with no reading.

## Calls [#calls]

Answers come from `https://api.openai.com/v1/chat/completions` in the OpenAI chat completions protocol, with the key. All four request options reach OpenAI.
