Skip to content

OpenAI-compat: gateway /v1 plus origin-only Helicone-Target-URL, not oai.helicone.ai #5795

Description

@cursor

Working config (gateway.helicone.ai/v1 + Helicone-Target-URL origin)

oai.helicone.ai proxies OpenAI. ai-gateway.helicone.ai uses Helicone-managed keys. Helicone-OpenAI-Api-Base is the oai.helicone.ai header. Putting /v1 in Helicone-Target-URL duplicates the path the gateway already appends.

A Chat Completions host whose public catalog is GET https://api.pzero.studio/v1/models (no key) fits the generic gateway if base_url is https://gateway.helicone.ai/v1, Helicone-Target-URL is the origin only, api_key is that host's Bearer, and Helicone-Auth is the Helicone key.

import os
from openai import OpenAI

client = OpenAI(
    api_key="<Bearer key for that host>",
    base_url="https://gateway.helicone.ai/v1",
    default_headers={
        "Helicone-Auth": f"Bearer {os.environ['HELICONE_API_KEY']}",
        "Helicone-Target-URL": "https://api.pzero.studio",
    },
)

r = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Say hello"}],
)

Keep embeddings and multimodal off this host.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions