Skip to main content
This integration method is maintained but no longer actively developed. For the best experience and latest features, use our new AI Gateway with unified API access to 100+ models.
Instructor is a popular framework for extracting structured output from text using LLMs. Here’s how you can use Helicone to track your calls while using Instructor:
1

Follow useinstructor.com to get setup with Instructor's JS SDK.

2

Modify the base url and add a Helicone-Auth header

client = instructor.from_openai(OpenAI(
    base_url="https://oai.helicone.ai/v1",
    api_key=OPENAI_API_KEY,
    default_headers={
        "Helicone-Auth": "Bearer " + HELICONE_API_KEY
    }
))
3

Call OpenAI using Instructor and see the logs on Helicone.