How to create a read-only OpenAI Admin API key

What an OpenAI Admin API key can and can't do, how it differs from a project key, and how to create, store and revoke a read-only one.

Braid5-minute read

Only an OpenAI organization owner can create an Admin API key. Open Organization settings, then Admin keys, choose Create new admin key, name it, select Read only permissions and copy the key, which starts with sk-admin- and is shown once. A read-only Admin key can read usage, costs, projects and key details for the whole organization, but it can't call models or change anything.

Admin keys and project keys compared

Your application uses project keys. Reporting tools, including your own scripts that read usage and costs, need an Admin key, which works only on OpenAI's administration endpoints. OpenAI's Admin API guide says they can't be used for anything else, and the reverse holds too: call an administration endpoint with a project key and OpenAI refuses it with a 403 error about missing scopes.

DetailAdmin keyProject key
Starts withsk-admin-sk-proj-
Belongs toThe whole organizationOne project
Calls modelsNoYes
Reads usage and costsYes, for every projectNo
Who can create oneOrganization ownersProject members, unless the organization restricts key creation
WhereOrganization settings, Admin keysThe project's API Keys settings

How to create a read-only Admin key

  1. Sign in to the OpenAI platform as an organization owner, and check that the organization picker shows the organization you use for the API. If there's no Admin keys page in the settings, you aren't an owner and need to ask one.
  2. Open Organization settings, then Admin keys, and choose Create new admin key.
  3. Name it after what will use it, such as the vendor or the script, so the key list shows who each key is for.
  4. Under permissions, choose Read only. Reporting only needs to read. A tool that asks for write access to report on your spend is asking for more than it needs.
  5. Set an expiration date if your policy calls for one. It's optional, and if you set it, put the date in a calendar so the tool doesn't stop working without warning.
  6. Copy the key straight away, because OpenAI shows it once. Paste it directly into the tool's key field or your secret store, not into chat, email or a document.

To check the key works, ask for the last week of daily costs. A JSON page of cost buckets means it does.

curl "https://api.openai.com/v1/organization/costs?start_time=$(date -d '7 days ago' +%s)&limit=7" \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

Our guide to the OpenAI Usage and Costs API goes through grouping and pagination from there.

What a read-only Admin key can and can't do

What it can read

Read only doesn't mean it sees nothing sensitive. Depending on the scopes it has, an Admin key can read:

  • usage and costs by day, project, API key and model, for every project;
  • the list of projects, and each project's keys and service accounts, with key names, the last characters of each key, owners, and when each key was created and last used;
  • the organization's members, including their email addresses;
  • the list of Admin keys, including when each one expires;
  • the audit log of administrative actions, if an organization owner has turned audit logging on.

What it can't do

It can't see your prompts or your models' responses, because usage and cost data hold counts and dollar amounts, not content. Without write permissions it can't create projects or keys, change limits or invite anyone.

That last point is why read-only matters. An Admin key with write permissions can't call models either, but it can create projects, service accounts and project keys, and those keys can. A leaked write key can end up costing money. A leaked read-only key exposes information, such as your spend and your members' emails, but can't run up a bill.

How to store, rotate and revoke an Admin key

Keep the key only where the reporting job runs, in a secret manager or your host's encrypted environment variables. OpenAI's examples read it from an environment variable named OPENAI_ADMIN_KEY, which keeps it apart from the OPENAI_API_KEY your application uses. The application that serves users has no reason to hold it.

Use one Admin key per tool, so you can revoke one without breaking the others. To rotate a key, create a new one with the same permissions, update the tool, confirm it works, then delete the old key on the Admin keys page. If a key might have leaked, delete it first and replace it afterwards. Every quarter, review the Admin keys list, or call GET /v1/organization/admin_api_keys, and delete any key nobody can explain. Our post on OpenAI API key security covers leak response in more detail.

Questions to ask a vendor before you give them one

  • Which OpenAI endpoints will you call? A good answer lists them, rather than saying "your usage data".
  • How do you store the key, and will anyone, including your staff, ever see it again?
  • Will you ever write to my OpenAI account? For reporting, the answer should be no.
  • What happens to the data you've already imported if I revoke the key? Revoking takes one click in OpenAI, and the vendor should be able to delete what it stored.

Common questions

Can an OpenAI Admin API key make model requests?

No. Admin keys work only on administration endpoints, such as usage, costs, projects, members and audit logs. To call models you need a project key.

Why can't I see Admin keys in my OpenAI settings?

Admin keys are an organization owner setting, so the page only appears for owners. Ask an owner to create the key and paste it into the tool themselves, which also means it never passes through anyone else's hands.

What happens if I lose an OpenAI Admin key?

It can't be recovered, because OpenAI shows the full key only once. Delete the old key on the Admin keys page and create a new one with the same permissions.

Can a read-only Admin key see my prompts?

No. The usage and cost endpoints return token counts, request counts and dollar amounts, not the content of requests or responses.

Where Braid fits

Braid connects with one read-only Admin key, created by an owner. It reads usage, costs, projects and API key details to build your reports, and the list of Admin keys to show when yours expires. It never writes to your OpenAI account and never reads prompts or responses.

The key is encrypted before it reaches Braid's database and is never shown again. Of each project key, Braid keeps only the name and the last characters OpenAI shows, not the key itself. The details are on our security page, and the sample report shows what that data becomes.

Try Braid with your team.

We're looking for teams to test Braid before launch. Get full access to all premium features for free. All we ask is for feedback on what works and what needs improvement.

  1. Request beta access.Tell us your name, role and company.
  2. Receive your invitation.If approved, you'll get an email inviting you to join.
  3. Set up your company.Connect your provider, map your AI use cases and invite your team.

Request beta access.

Justin, Braid's founder, reviews every request. If yours is approved, you'll get an invitation by email.

Free during beta. No credit card required.