[Bug] AI Manager – OpenAI “project” API keys (sk-proj-...) not recognized

Wappler Version: 7.3.8

OS: macOS (MacBook Pro 14")
Environment: Docker target
AI Provider: OpenAI


Issue description

When trying to use the new OpenAI project-based API keys (which start with sk-proj-...) in Wappler’s AI Manager, the assistant fails to connect and returns the following error:

429 You exceeded your current quota, please check your plan and billing details.

However, my OpenAI account is active, has available quota, and the same API key works perfectly when tested via curl or Postman.


Steps to reproduce

  1. Go to https://platform.openai.com/api-keys

  2. Create a new API key (default “project” key – format: sk-proj-...)

  3. Copy and paste it in Wappler → Preferences → AI → OpenAI API Key

  4. Try to run any prompt in the AI Manager


Expected behavior

Wappler should recognize and use the sk-proj-... keys as valid OpenAI credentials, just like older sk-... keys.


Actual behavior

The AI Assistant fails to respond and throws the 429 quota error, indicating the key is rejected or not interpreted correctly by Wappler.


Additional notes

  • OpenAI recently migrated all user keys to the new “Project” system, and newly created keys now start with sk-proj-....

  • These keys are valid and work directly with OpenAI’s API (tested via curl).

  • The issue seems to be that Wappler’s AI integration still expects the legacy format (sk-...).


Request

Please update Wappler’s OpenAI integration to support the new Project API keys (sk-proj-...), as OpenAI no longer issues the old key format.


:brain: Tested Models:

  • gpt-3.5-turbo

  • gpt-4o

  • gpt-4o-mini
    (All fail with the same error)


:envelope: Thanks a lot for all your amazing work — Wappler’s AI Assistant looks great, and this update will ensure it stays compatible with OpenAI’s new key system.

Hi,
Any update?
Many thanks

Seems that project and organization options are also required when using project key, we will add those to the settings.

As a workaround until we added them you can use environment variables of your OS. Set organization using OPENAI_ORG_ID and project using OPENAI_PROJECT_ID.

Hi @patrick ,
Thanks for your answer. I did it + I updated to Wappler 7.5.0 wich includes theses IA settings
The result is the same. Any idea?

I don't have a project key to test but I don't see in the docs that it should work different. Which API endpoint did you test via curl and which headers were set?

I don't see any problems with the current implementation, are you sure it is not a problem with your account? What were the curl/postman tests you did, note that the openai playground doesn't require any api key or credits for testing.

429 You exceeded your current quota any help appreciated - API - OpenAI Developer Community

We don't expect any kind of format, we use the official openai sdk and the api didn't change with the new api keys. Make sure to also apply the project ID starting with proj_... and the organization ID starting with org-... and not just the names.