OpenAI Assistants Integration
Integrate OpenAI Assistants with Helicone to monitor and analyze your assistant usage.
Introduction
OpenAI Assistants enable you to create advanced conversational agents with specialized capabilities. By integrating them with Helicone, you can monitor performance, analyze interactions, and gain valuable insights into your assistant’s usage.
Integration Steps
Create an Account and Generate an API Key
Log into Helicone or create a new account. Once logged in, generate a Helicone API key.
Keep your API keys secure and do not expose them publicly.
Set Environment Variables
Set your OpenAI and Helicone API keys as environment variables:
Install the OpenAI SDK
If you haven’t already, install the OpenAI SDK:
Configure the OpenAI Client to Use Helicone Proxy
Modify your OpenAI client configuration to route requests through the Helicone proxy and include the Helicone-Auth
header:
Start Using OpenAI Assistants with Helicone
With the above setup, any calls to OpenAI Assistants will automatically be logged and monitored by Helicone. You can now implement your assistant without any additional configuration.
Here’s a basic example of creating and using an assistant:
Replace the assistant’s name, instructions, and messages with content relevant to your application.
Optional: Grouping Calls with Helicone Sessions
To group related API calls and analyze them collectively, you can use Helicone’s session tracking features. This is useful for grouping all interactions within a single conversation or user session.
Generate a Session ID
Generate a unique session ID that will be used to track the session:
Include Session Headers in Your Requests
Include the session headers when you make API requests. This way, the session information is attached to each request, allowing Helicone to group and analyze them together.
Include headers in your API requests:
By including the session headers in each request, you have more granular control over session tracking. This approach is especially useful if you want to handle sessions dynamically or manage multiple sessions concurrently.
Was this page helpful?