Error creating Read Only API key

I’m getting the error:

Request includes unauthorized scopes: api.all.read. Please check and remove these scopes.

when trying to create a new read only API key here:

https://platform.openai.com/settings/proj_blah/api-keys

Yet I can create a read & write key no problem … this looks like a bug?

2 Likes

I was getting the same error… GPT-4o tells me:

Why the Error Occurs

  • OpenAI defaults all API keys to full permissions for individual users.
  • Scoped permissions like api.all.read are reserved for organizational accounts or higher-tier plans (e.g., Enterprise).
  • As an individual user, you cannot create scoped API keys, which is why the request fails when you try to add api.all.read.

Can You Get a Read-Only Key?

  • No, not officially on a free or individual account. You only get keys with full access.
  • Scoped permissions (like read-only keys) are currently not available unless you’re on an organizational plan or enterprise tier.

Workaround for “Read-Only” Behavior

While you can’t create a true read-only API key, you can simulate the effect programmatically:

  1. Client-Side Restrictions:
    Implement application logic to ensure the key is only used for reading purposes. For example:
  • Block any actions or API calls that would modify or fine-tune resources.
  • Only allow endpoints like completions or chat.
  1. Environment Management:
  • Store separate API keys for different purposes (e.g., “production” and “development”).
  • Treat certain keys as “read-only” by convention in your workflows.
  1. Monitoring and Alerts:
    Use API usage monitoring tools to ensure that keys intended for “read-only” purposes are not misused.

Final Note

This is a current limitation of OpenAI’s free and individual accounts. If you need stricter key management (e.g., fine-grained permissions or read-only scopes), upgrading to a plan that supports organizational features may be required.

:roll_eyes: :rofl:
Does this help?

No, this doesn’t make sense.

Why offer the option then raise an error when you try to use it?

That’s just stupid! A total interface faux pas.

Replicated it here, i’ll pass it on, thanks for flagging.

1 Like

Only thing I could think of is it was available with the free trial credits but those’ve been used up now or they expired… but maybe not. Thx @Foxalabs