OpenAI uses a long-lived API key for every endpoint (Documentation Index
Fetch the complete documentation index at: https://authsome.agentr.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
api.openai.com). Authsome stores the key encrypted in the local vault, injects it at request time through the proxy, and keeps it out of shell history, process listings, and environment dumps.
At a glance
| Provider name | openai |
| Display name | OpenAI |
| Auth type | API key |
| Flow | api_key |
| Header | Authorization: Bearer <key> |
| Key pattern | ^sk-[A-Za-z0-9_-]{20,}$ |
| Proxy host | api.openai.com |
| Env var | OPENAI_API_KEY |
| Where to get a key | platform.openai.com/api-keys |
Get a key
Create a key in the OpenAI dashboard at platform.openai.com/api-keys. Keys start withsk- followed by at least 20 letters, digits, underscores, or hyphens.
Authsome validates the format on input and rejects pastes that obviously aren’t keys:
Log in
http://127.0.0.1:7998. Paste the key into the masked input and submit. The terminal prints Successfully logged in to openai (default).
On a headless machine without a graphical session, authsome falls back to masked terminal input via getpass. The browser bridge is skipped automatically when no display is available.
Verify:
Use the key
Run the agent under the proxy. The library tab is for embedding authsome inside a larger Python orchestrator.OPENAI_API_KEY=authsome-proxy-managed in the child’s environment and injects the real key into outbound requests to api.openai.com. The child process never sees the actual value. With the OpenAI Python SDK, no code change is required: it reads the env var, makes the request, and the proxy substitutes the header on the way out.
Multiple keys
A personal key and a team key on the same machine:--connection <name> on login and on every read command to keep two or more accounts on the same provider side by side. See Multiple connections per provider for the full pattern.
Rotate the key
To replace the stored key with a new one:--force overwrites the existing connection without removing it first. Pass --connection <name> to target a non-default connection.
To invalidate the old key at OpenAI as well, delete it in the OpenAI dashboard before running --force.
Remove the key
revoke and remove are equivalent for OpenAI.
Override the bundled definition
To change the header shape, the proxy host, or the validation regex, drop a custom JSON at~/.authsome/providers/openai.json:
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Incorrect API key provided from OpenAI | Key was revoked at OpenAI | Generate a fresh key and run uvx authsome login openai --force. |
| Key pattern rejected at login | Pasted something other than a key, or pasted with whitespace | Re-copy the key from the OpenAI dashboard. Authsome trims trailing whitespace but not embedded whitespace. |
SDK sees authsome-proxy-managed and fails | Running outside uvx authsome run | Use authsome run or fall back to eval "$(uvx authsome export openai --format env)". |
TLS error against api.openai.com under the proxy | mitmproxy CA not trusted | See Proxy networking. |
What’s next
Run agents with the proxy
Keep the key out of the agent’s environment entirely.
Multiple connections per provider
Keep two or more keys on the same provider side by side.
API-key providers
All bundled API-key providers.
Provider schema
Every field in a provider definition.