Skip to main content

Overview

Helicone can proxy and observe TokenLab’s OpenAI-compatible requests by routing them through Helicone Gateway and targeting TokenLab.
Type: Observability GatewayPrimary Path: OpenAI-compatible chat completions through Helicone GatewaySupport Confidence: Supported observability path

Environment

export HELICONE_API_KEY="your-helicone-key"
export TOKENLAB_API_KEY="sk-your-tokenlab-key"

cURL

curl --request POST \
  --url https://gateway.helicone.ai/v1/chat/completions \
  --header "Authorization: Bearer $TOKENLAB_API_KEY" \
  --header "Helicone-Auth: Bearer $HELICONE_API_KEY" \
  --header "Helicone-Target-Url: https://api.tokenlab.sh" \
  --header "Helicone-Target-Provider: TokenLab" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "gpt-5.4-mini",
    "messages": [
      {
        "role": "user",
        "content": "Say hello from TokenLab through Helicone."
      }
    ]
  }'

OpenAI SDK

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.TOKENLAB_API_KEY,
  baseURL: "https://gateway.helicone.ai/v1",
  defaultHeaders: {
    "Helicone-Auth": `Bearer ${process.env.HELICONE_API_KEY}`,
    "Helicone-Target-Url": "https://api.tokenlab.sh",
    "Helicone-Target-Provider": "TokenLab",
  },
});

const response = await client.chat.completions.create({
  model: "claude-sonnet-5",
  messages: [{ role: "user", content: "Write one concise product summary." }],
});

Scope

This setup is for OpenAI-compatible /v1 traffic. TokenLab also exposes native Responses, Anthropic Messages, and Gemini-compatible endpoints; use direct TokenLab routes for those native formats unless your observability proxy explicitly supports them.