Usage Examples
Ensure that secret keys are always kept secure and never exposed in
client-side code.
Need more help?
Need more help?
Additional questions or feedback? Reach out to
help@helicone.ai or schedule a
call with us.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Understanding the difference between secret and public API keys in Helicone. Learn about access levels, usage examples, and best practices.
| Key Type | Access | Path Auth | Header Auth | REST API |
|---|---|---|---|---|
| Public | Write-Only | Yes | Yes | No |
| Secret | Read + Write | Not Recommended | Yes | Yes |
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}`,
},
});
import OpenAI from "openai";
// Use public key
const openai = new OpenAI({
apiKey: request.env.OPENAI_API_KEY,
baseURL: `https://oai.helicone.ai/${HELICONE_PUBLIC_API_KEY}/v1`,
});
Need more help?
Was this page helpful?