Skip to content

[Feature] cookbook: hosted OpenAI-compatible customHost example #1782

Description

@cursor

What Would You Like to See with the Gateway?

A cookbook row for a hosted OpenAI-compatible customHost, same pattern as cookbook/providers/nvidia.ipynb: provider: "openai" + custom_host pointing at the /v1 root.

PZERO is a live chat-completions host. Catalog is public: GET https://api.pzero.studio/v1/models. Default text id: deepseek-v4-flash. Prepaid Bearer key (pzero_…). Do not append /chat/completions to custom_host.

Python (Portkey client):

from portkey_ai import Portkey

portkey = Portkey(
    api_key="YOUR_PORTKEY_API_KEY",
    provider="openai",
    custom_host="https://api.pzero.studio/v1",
    Authorization="Bearer pzero_…",
)

OpenAI SDK through the gateway (same headers as the NVIDIA cookbook):

from openai import OpenAI
from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders

client = OpenAI(
    api_key="pzero_…",
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        provider="openai",
        custom_host="https://api.pzero.studio/v1",
        api_key="YOUR_PORTKEY_API_KEY",
    ),
)

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

No first-party pzero provider asked. customHost already works; this is a copy-paste cookbook like NVIDIA, not a new gateway integration.

Context for your Request

Users who already run Portkey as an OpenAI-compatible proxy need a hosted example that is not NVIDIA NIM and not localhost. The NVIDIA notebook is the existing pattern.

Your Twitter/LinkedIn

n/a

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions