How to Set Billing Limits and Restrict Model Usage for a Project via OpenAI API

I’m looking for guidance on how to manage billing limits and restrict model access for specific projects using the OpenAI API.

  1. Billing Limits: Is there a way to set a maximum billing cap or token usage limit for a project (e.g., 35,000 tokens/month) to prevent overages? If not directly through the API, are there any recommended approaches or best practices for achieving this?
  2. Restricting Model Usage: How can I allow only specific models (e.g., gpt-4o-mini, gpt-4o-mini-2024-07-18, text-embedding-3-small) and block access to all others? I’ve attempted setting rate limits for certain models, but I’m unsure how to effectively block the rest.

Any help or examples would be greatly appreciated!

Thankss

1 Like