Skip to main content
Helicone provides multiple ways to integrate with OpenAI, from simple proxy routing to zero-latency async logging.

Integration Methods

Proxy Integration

Route requests through Helicone’s proxy. Simple setup with minimal code changes.

AI Gateway

Use the AI Gateway for access to multiple providers including OpenAI.

Async Logging

Zero-latency logging using OpenLLMetry. No proxy required.

Azure OpenAI

Special integration for Azure-hosted OpenAI models.

Quick Start

1

Get your API keys

You’ll need:
2

Update your base URL

Change the base URL to route requests through Helicone:
3

Make requests as usual

Use the OpenAI SDK normally:
4

View your logs

All requests are now logged to your Helicone dashboard.

Streaming Support

Helicone fully supports OpenAI streaming:

Custom Properties

Track custom metadata with your requests:

Session Tracking

Track multi-turn conversations and agent workflows:
Learn more about Session Tracking.

Response Caching

Reduce costs and latency with response caching:
Learn more about Response Caching.

Rate Limiting

Control usage per user or API key:
Learn more about Rate Limiting.

Function Calling

Helicone fully supports OpenAI function calling:

Vision Models

Use GPT-4 Vision with Helicone:

Embeddings

Track embedding requests:

Azure OpenAI

Integrate with Azure-hosted OpenAI:

Error Tracking

Helicone automatically tracks errors and retry attempts:
View errors in your dashboard with:
  • Error message and type
  • Request parameters
  • Retry attempts
  • User and session context

Zero-Latency Integration

For production applications where latency is critical, use async logging:
Learn more about Async Logging.

Best Practices

Never hardcode API keys. Use environment variables:
Always include user and session IDs for better observability:
Add context with custom properties:
Reduce costs with caching:

Troubleshooting

  1. Verify your Helicone API key is correct
  2. Check that the Helicone-Auth header is formatted correctly: Bearer sk-helicone-...
  3. Ensure you’re using the correct base URL: https://oai.helicone.ai/v1
  4. Check your network allows connections to helicone.ai
  • Make sure you’re passing your OpenAI API key (not Helicone key) as the apiKey
  • Pass your Helicone API key in the Helicone-Auth header
  • Format: Helicone-Auth: Bearer sk-helicone-...
  • Helicone proxy adds ~20-50ms latency
  • For zero-latency, use async logging
  • Check your geographic region - we have global endpoints

Next Steps

Session Tracking

Track multi-turn conversations

Custom Properties

Add custom metadata

Response Caching

Reduce costs with caching

Prompt Management

Version and deploy prompts