Docs · Provider

OpenAI in Claude Code, Codex, Gemini CLI and OpenCode

OpenAI serves its models on two APIs at api.openai.com: Responses and Chat Completions. Its own models are best asked on Responses, and its newest answer only there. Add an OpenAI API key to packinggoods once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use OpenAI’s models through packinggoods’s local gateway at 127.0.0.1:3425, each agent with a model of its own. Codex’s requests go to OpenAI as they are; the other agents’ are translated on the way.

This page is about an API key from platform.openai.com. A ChatGPT Plus or Pro subscription is signed in to separately; see Subscriptions in any agent.

Add OpenAI

  1. Get a keyMake one on platform.openai.com. It starts with sk-.
  2. Add the providerIn packinggoods’s Providers tab, press + Add provider, pick OpenAI, paste the key and save. packinggoods asks OpenAI which models the key can use.
  3. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose an OpenAI model such as gpt-6.1-sol.
Terminal
packinggoods provider add openai <key>
packinggoods provider test openai

Model ids in packinggoods are provider/model, so OpenAI’s read openai/gpt-6.1-sol: the provider, then OpenAI’s own id. The key is kept in packinggoods’s settings; packinggoods doesn’t take it from your shell.

Already set OpenAI up in OpenCode or another app packinggoods imports from? The import brings it in as the OpenAI provider.

Endpoints

APIAddressUsed for
Responseshttps://api.openai.com/v1OpenAI’s own models, ids starting gpt-, codex or o and a digit: Codex’s requests as they are, Claude Code’s, Gemini CLI’s and OpenCode’s translated
Chat Completionshttps://api.openai.com/v1the model list, and any other model the key lists

packinggoods’s OpenAI provider has no Anthropic Messages address, so Claude Code’s requests are always translated. For OpenAI’s own models packinggoods keeps Responses first even for an agent that speaks Chat Completions. When OpenAI answers that a model is served only on /v1/responses, packinggoods asks again there and remembers it. To send a model on one API yourself:

Terminal
packinggoods model api openai/gpt-5.5 chat
packinggoods model api openai/gpt-5.5 --reset
packinggoods model apis openai

Azure OpenAI is a provider of its own, Azure OpenAI. Give it your resource’s endpoint, https://<resource>.openai.azure.com, and its key. packinggoods uses the v1 API under /openai/v1 for Chat Completions and Responses, sends the key in the api-key header, and lists the resource’s deployments as its models. A deployment named for its model, such as gpt-5-codex, goes to Responses first too.

Model list

packinggoods fetches the list from OpenAI, at https://api.openai.com/v1/models, so agents see the models your key can use. Names, context windows, reasoning levels and prices come from models.dev’s openai catalog. A reasoning model OpenAI has just listed, before its levels are known, gets those of the newest reasoning model in its family: gpt-6.1-sol got gpt-6-sol’s. Pick the models agents see in the provider’s model list, or from the terminal:

Terminal
packinggoods provider models openai +gpt-6.1-sol +gpt-6-luna +gpt-5.5
packinggoods provider refresh-every openai 1d

In each agent

Terminal
packinggoods claude openai/gpt-6.1-sol
packinggoods codex openai/gpt-6.1-sol
packinggoods gemini model openai/gpt-6.1-sol
packinggoods opencode openai/gpt-6.1-sol

What packinggoods does for OpenAI

Terminal
packinggoods provider set openai compaction=native
packinggoods provider set openai additional-tools=off

Reasoning

OpenAI’s Responses API searches the web itself. When an agent offers its model web search, as Codex and Claude Code do, packinggoods gives the model OpenAI’s own web_search tool on Responses, and OpenAI runs the search.

Cost and usage

Several keys and failover

One OpenAI provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. To keep keys apart instead, say from two organizations, add the provider again: the second is openai-2.

Terminal
packinggoods provider spend-cap openai <key> 20 month
packinggoods provider key-balance openai <key> 25
packinggoods provider fallback openai deepseek/deepseek-v4-pro

Troubleshooting

Azure OpenAI in Codex, Claude Code and other agents

FAQ

How do I use OpenAI’s models in Claude Code?

Add your OpenAI API key in packinggoods (Providers, Add provider, OpenAI), then pick a model such as gpt-6.1-sol on Claude Code’s row, or run packinggoods claude openai/gpt-6.1-sol. OpenAI serves no Anthropic Messages API, so packinggoods translates Claude Code’s requests to OpenAI’s Responses API at https://api.openai.com/v1 and the replies back, the reasoning summary as thinking.

Can Codex use an OpenAI API key instead of a ChatGPT sign-in?

Yes. Add the key, then run packinggoods codex openai/gpt-6.1-sol. Codex speaks Responses, so its requests go to OpenAI as they are, custom tools and reasoning included, and Fast is sent as priority processing. A ChatGPT Plus or Pro sign-in is set up separately, in Subscriptions.

How do I use GPT models in OpenCode?

Pick the model in packinggoods, or run packinggoods opencode openai/gpt-6.1-sol. OpenCode speaks Chat Completions, but OpenAI’s own models go to Responses first, so packinggoods translates OpenCode’s requests there and the replies back. To send a model on Chat Completions instead, run packinggoods model api openai/gpt-5.5 chat.

Can Gemini CLI use OpenAI?

Yes. Gemini CLI speaks Google’s Gemini API, so packinggoods translates its requests to OpenAI’s Responses API and the replies back, streaming and tool calls included. Run packinggoods gemini model openai/gpt-6.1-sol.

Does packinggoods keep OpenAI’s prompt cache?

Yes. Codex’s own prompt_cache_key goes on as it is. A translated request without one gets a key made from its session or first user message, hashed so it names nothing of the agent. With several keys, a conversation stays on its key while its cache is warm.

Why does OpenAI say the encrypted content could not be verified?

OpenAI reads only reasoning it sealed for the same key, organization or account. When a conversation carries reasoning sealed elsewhere, packinggoods asks again without those items and remembers it for the conversation.

Does packinggoods support Azure OpenAI?

Yes, as its own provider, Azure OpenAI. Give it the resource’s endpoint and key; packinggoods uses the v1 API under /openai/v1, sends the key in the api-key header and lists the resource’s deployments as models.

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.