Quick Start
@provider-slug/model format routes requests to the correct provider. Set up providers in Portkey’s Model Catalog by adding your provider credentials and naming the provider (e.g., openai-prod). The slug becomes @openai-prod.
What Gets Traced
The OpenAI instrumentor captures all calls through Portkey’s gateway:- Chat completions - Inputs, outputs, and token usage across any provider
- Tool / function calls - Arguments and results for each tool invocation
- Streaming responses - Streamed completions with aggregated tokens
Example: Multi-Provider Routing
Switch between providers by changing the model slug. Each@provider-slug maps to credentials you configured in Portkey’s Model Catalog:
openai-prod or anthropic-prod. The provider slug becomes @openai-prod or @anthropic-prod.
Example: Fallbacks and Load Balancing
Use a Portkey config to define fallback or load-balancing rules. Create the config in the Portkey dashboard and pass its ID via theconfig header. HoneyHive traces whichever provider handles the request:
Environment Configuration
Troubleshooting
Traces not appearing
- Check the instrumentor - Ensure
OpenAIInstrumentoris initialized withtracer_provider=tracer.providerbefore making any calls - Verify
base_url- The OpenAI client must point to Portkey’s gateway (PORTKEY_GATEWAY_URLorhttps://api.portkey.ai/v1) - Check
HH_API_KEY- Ensure your HoneyHive API key is set correctly
Requests failing with provider errors
- Check the model slug - Use the
@provider-slug/model-nameformat (e.g.,@openai-prod/gpt-4o-mini). The provider slug must match a provider you configured in Model Catalog - Verify model name - Use the model name expected by the target provider (e.g.,
gpt-4o-minifor OpenAI,claude-sonnet-4-5-20250929for Anthropic)
Duplicate spans
If you use both a Portkey client and a direct OpenAI client in the same app, both will be traced by the same instrumentor. Use HoneyHive’s@trace decorator to group related calls into named spans for clarity.
Related
OpenAI Integration
Base OpenAI integration that powers Portkey tracing
LiteLLM Integration
Alternative multi-provider gateway with HoneyHive support
Use Portkey for LLM Evaluators
Route LLM evaluator calls through Portkey to access any supported model
Custom Spans
Create spans for business logic around API calls
Enrich Your Traces
Add user IDs and custom metadata to traces

