Portkey + DeepInfra
Portkey is the Control Panel for AI apps. With it’s popular AI Gateway and Observability Suite, hundreds of teams ship reliable, cost-efficient, and fast apps. With Portkey, you can- Connect to 150+ models through a unified API,
- View 40+ metrics & logs for all requests,
- Enable semantic cache to reduce latency & costs,
- Implement automatic retries & fallbacks for failed requests,
- Add custom tags to requests for better tracking and analysis and more.
Quickstart
Since Portkey is fully compatible with the OpenAI signature, you can connect to the Portkey AI Gateway through OpenAI Client.- Set the
base_urlasPORTKEY_GATEWAY_URL - Add
default_headersto consume the headers needed by Portkey using thecreateHeadershelper method.
With OpenAI Client
Observability with Portkey
By routing requests through Portkey you can track a number of metrics like - tokens used, latency, cost, etc. Here’s a screenshot of the dashboard you get with Portkey:

