Learn to integrate OpenAI with Portkey, enabling seamless completions, prompt management, and advanced functionalities like streaming, function calling and fine-tuning.
openai
baseURL
to the Portkey Gateway URLprovider
, apiKey
, ‘virtualKey’ and others.developer
role replaces the previous system
role.user
parameter in OpenAI requests, enabling you to monitor user-level costs, requests, and more.
user
parameter in your requests, Portkey logs will display the associated user ID, as shown in the image below:
user
parameter, Portkey allows you to send arbitrary custom metadata with your requests. This powerful feature enables you to associate additional context or information with each request, which can be useful for analysis, debugging, or other custom use cases.
portkey.prompts.completions.create
method as above.
Log view for an image generation request on OpenAI
audio
methods on OpenAI API. Check out the below guides for more info:
Check out the below guides for more info:
search_context_size
:high
: Most comprehensive context, higher cost, slower responsemedium
: Balanced context, cost, and latency (default)low
: Minimal context, lowest cost, fastest response