uezo / aiproxy

🦉AIProxy is a reverse proxy for ChatGPT API that provides monitoring, logging, and filtering requests and responses.
Apache License 2.0
38 stars 1 forks source link

Make it easier to set base_url for API clients #29

Closed uezo closed 3 months ago

uezo commented 3 months ago

Enable routing API clients through a custom proxy by setting base_url

This change allows API clients like OpenAI and Anthropic to easily configure their base_url to route requests through a specified proxy server. This simplifies the integration of various services through a unified proxy endpoint, offering better control over API traffic and network architecture.

Examples:

client = openai.Client(
    api_key="YOUR_API_KEY",
    base_url="http://127.0.0.1:8000/openai"
)
client = Anthropic(
    api_key="YOUR_API_KEY",
    base_url="http://127.0.0.1:8000/anthropic"
)