Python
GateCtr + OpenAI Python SDK
Drop-in replacement for the official OpenAI Python client
1
Install
No additional packages required. Use your existing OpenAI Python SDK installation.
2
Configure
Before
from openai import OpenAI
client = OpenAI(api_key="sk-...")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)After GateCtr
from openai import OpenAI
client = OpenAI(
api_key="sk-...",
base_url="https://api.gatectr.com/v1"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)3
Test
Make a test call and check the GateCtr dashboard for token savings and cost data.
What GateCtr does under the hood for OpenAI Python SDK
When you route OpenAI Python SDK calls through GateCtr, every request is automatically compressed (up to 40% fewer tokens), scored for complexity (to select the optimal model), and checked against your budget cap before reaching the LLM provider. You get full observability β tokens, cost, latency β in the GateCtr dashboard.
Compatible models
Start saving with OpenAI Python SDK β free
No credit card required. Up and running in 5 minutes.
Start free