Use OpenAI credentials
Configure ChatGPT, OpenAI API, Codex backend, and Buffaly secret paths without mixing account types or exposing credential values.
Quick answer
There are several OpenAI-related credential paths in Buffaly, and they are not interchangeable. Start by identifying the selected provider transport before deciding which credential path matters.
| What you have | What it is for | Buffaly route to check |
|---|---|---|
| ChatGPT account/subscription login | Account-based access used by Codex backend/profile flows when configured. | Codex Auth Feature plus Codex Backend Feature |
| OpenAI API key | Conventional API-key access for OpenAI API-backed features. | OpenAI Feature / ApiKey and settings UI key controls |
| Codex backend token/profile | Buffaly-managed or legacy Codex auth profile material. | Codex auth/profile settings and backend route |
| Buffaly secret | Protected value stored by Buffaly for tools, services, or providers. | Secret store or DB-backed feature settings; never prompt text |
If the selected provider transport is openai plus codex_backend, start with Codex auth/profile and backend settings. If the selected route is a conventional OpenAI API-key route, configure the OpenAI API key and do not confuse it with ChatGPT/Codex profile login.
What Buffaly means by OpenAI credentials
ChatGPT account or subscription
An account login that may matter for Codex backend authentication. A subscription is not itself an API key, and passwords, cookies, or receipts should never be pasted into prompts.
OpenAI API key
OpenAIFeature loads an ApiKey from the DB-backed OpenAI Feature row. Settings controls can save, delete, and show status without revealing the value.
Codex backend credentials
CodexAuthFeature and CodexBackendFeature manage profile/auth mode, token paths, backend URL, endpoint path, default model, timeouts, and backend behavior.
Before you configure anything
- Decide which route is in use:
openaipluscodex_backend,openaiplusresponses_api, or a provider-native module. - Check the provider catalog for provider, transport, model, and reasoning availability.
- Keep API keys, OAuth tokens, passwords, and browser cookies out of prompts, markdown files, wiki articles, and source files.
- Use the settings UI, configured feature rows, or typed secret storage for credential material.
- Verify with status flags, masked hints, active account labels, provider rows, and smoke-test results without printing secrets.
Configure an OpenAI API key
Use this path when the feature you are using needs a conventional OpenAI API key.
- Open the Buffaly settings UI for the target installation.
- Find the OpenAI API key section.
- Save the API key through the settings UI or configured secret path.
- Confirm the UI shows key status without revealing the key.
- Verify the OpenAI API-backed feature with a small safe test.
OpenAIFeature.CreateFromSettings() loads the OpenAI Feature row; BuffalyAgentSettingsService.SaveOpenAiKey(...) persists the key; DeleteOpenAiKey(...) clears it. Do not commit the key to git or store it in prompt skills, markdown, .pts, implementation code, or provider manifests.Configure Codex backend / ChatGPT-style credentials
Use this path when the selected OpenAI transport is codex_backend. Do not treat an OpenAI API key as a replacement for Codex profile/OAuth/backend credentials unless the selected route source says so.
- Check Codex auth/profile status and auth mode, including
buffaly_profilesorlegacy_codex_file. - For profiles, use the settings UI profile/browser login flow when available.
- For legacy token files, verify the configured token path exists for the target installation.
- Confirm backend enabled state, base URL, endpoint path, default model, token file path, timeout, and user agent.
BaseUrl: https://chatgpt.com/backend-api
EndpointPath: codex/responses
DefaultModel: gpt-5.5
UserAgent: BuffalyCodexBackend/1.0
Configure provider, model, and reasoning selection
OpenAI credentials only solve authentication. The session still needs a valid provider/model tuple backed by the provider catalog.
- Use the provider/model/reasoning selector when available.
- Select only provider, transport, model, and reasoning values that appear in the catalog.
- For API verification, inspect
ProviderCatalogService.GetProviderCatalogandProviderCatalogService.GetProviderSelection(sessionKey). - Use
SetProviderSelectiononly with catalog-backed values.
ProviderCatalogService validates provider, transport, model, and reasoning together. Invalid tuples should fail explicitly instead of silently switching credentials or models.
How to ask Buffaly to help
Good requests name the desired operation but do not include secret values in ordinary chat unless the active UI path is explicitly collecting a secret.
Verification checklist
- The provider catalog includes
openai. - The selected transport is intended:
codex_backendorresponses_api. - The selected model appears under that transport and the reasoning level is supported or omitted.
- OpenAI API-key status is present for API-key routes; Codex auth/profile/account status is healthy for
codex_backend. Codex Backend Featurepoints at the expected backend URL, endpoint path, and default model for the target instance.- A safe completion prompt succeeds and logs contain no auth, missing-key, provider catalog, provider selection, or unsupported-model errors.
Common failures
ChatGPT Plus is not enough
A ChatGPT subscription is not an OpenAI API key. Configure the OpenAI key path or Codex auth path depending on the selected route.
API key saved, Codex still fails
codex_backend uses Codex auth/profile and backend settings. Check auth mode, token/root paths, backend URL, endpoint path, and logs.
Model selection fails
Provider selection is catalog-driven. Verify the model exists for the selected transport and the reasoning level is declared by that model.
A secret was pasted
Move it into the configured settings/secret path, avoid repeating it, and do not commit prompts, transcripts, or markdown containing the value.