-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
I’m trying to use a custom API base URL, but every request returns:
OpenAIException - Your request was blocked.
What I tested
- Using latest version of the library
- API works correctly with
requests - API key is valid
- Also tested with
litellm— same error
Notes
The same request works fine with direct HTTP requests, but fails only with this library.
Is there any special requirement for custom base URLs or headers that could cause this?
To Reproduce
To Reproduce
Steps to reproduce the behavior:
- Set a custom API base URL
- Initialize the OpenAI client with the custom base URL and API key
- Send a simple completion/chat request
- Observe the error:
OpenAIException - Your request was blocked.
The same request works correctly when using requests library directly, but fails with this library.
Code snippets
OS
Windows
Python version
Python 13
Library version
OpenAI v2.x.x
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working