Key TypeAccessPath AuthHeader AuthREST API
PublicWrite-OnlyYesYesNo
SecretRead + WriteNot RecommendedYesYes

Usage Examples

import OpenAI from "openai";

// Use secret or public key
const openai = new OpenAI({
  apiKey: request.env.OPENAI_API_KEY,
  baseURL: "https://oai.helicone.ai/v1",
  defaultHeaders: {
    "Helicone-Auth": `Bearer ${HELICONE_SECRET_API_KEY}`,
  },
});

Ensure that secret keys are always kept secure and never exposed in client-side code.

Questions?

Questions or feedback? Reach out to help@helicone.ai or schedule a call with us.