Integrations / Portkey
ConnectExperimental
Route model traffic through Portkey to Badgr
Use Portkey as the gateway and Badgr as an OpenAI-compatible provider behind it.
A setup guide only. Badgr has not tested this path, so expect to adjust it.
Why use Badgr for Portkey
- Badgr interface
- AI API
- Where Portkey fits
- External gateway
- Why Badgr
- Inference routing
- Badgr sits behind Portkey as an OpenAI-compatible host, so Portkey logging and policies still apply.
- Use it as one route in a load-balanced or fallback setup.
- One key for model traffic, with jobs and services available on the same account.
What you can do
- Add Portkey logging and retries in front of Badgr
- Load balance between Badgr and another provider
- Apply guardrails before requests reach Badgr
Quickstart: Portkey client with a custom host
import os
from portkey_ai import Portkey
client = Portkey(
provider="openai",
Authorization=f"Bearer {os.environ['BADGR_API_KEY']}",
custom_host="https://aibadgr.com/v1",
)
reply = client.chat.completions.create(
model="badgr-auto",
messages=[{"role": "user", "content": "Say hello."}],
)
print(reply.choices[0].message.content)How it works
- 1.Your app calls Portkey
- 2.Portkey applies its routing and policies
- 3.It forwards an OpenAI-style request to the Badgr host
- 4.The reply returns through Portkey
What you get
- Chat completions with Portkey logs and policies applied
Requirements
- A Badgr API key, saved as BADGR_API_KEY (get one at /get-api-key)
- A Portkey account or a self-hosted Portkey gateway
- Portkey SDK or config that supports a custom host
What it costs
- AI requests are billed per request at the rate listed for the model you choose (see Models). This page does not quote a fixed price.
- Your application keeps control of how many requests it sends. Use the limits in your own tool to cap usage.
- Portkey has its own pricing. Check it separately.
See pricing for how billing works.
Proof
No tested run is recorded for this integration yet. A receipt and example output will be added here after a real run, not before.
Troubleshooting
Custom host rejected
Confirm your Portkey version supports custom_host and that the host is allowed by your workspace settings.
Path errors
Use https://aibadgr.com/v1 and let Portkey add the route.
Key not forwarded
Pass the Badgr key as the provider Authorization value, not as your Portkey key.
Developer reference
Ready to start with Portkey?
Every run or service has a spending limit you set before it starts.