Skip to content

[Feature Request] docs: PZERO OPENAI_COMPATIBLE_MODEL example #4300

Description

@cursor

Required prerequisites

Motivation

CAMEL already talks to any OpenAI-compatible host via ModelPlatformType.OPENAI_COMPATIBLE_MODEL (https://docs.camel-ai.org/key_modules/models). People looking for prepaid, privacy-first inference still have to guess the host, key format, and that the parameter is url (not base_url).

A named PZERO example on that page, same shape as the OpenRouter sample, would let users paste and run. No first-party CAMEL platform enum required.

Solution

import os
from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.types import ModelPlatformType

model = ModelFactory.create(
    model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
    model_type="deepseek-v4-flash",
    url="https://api.pzero.studio/v1",
    api_key=os.environ["PZERO_API_KEY"],
    model_config_dict={"temperature": 0.2},
)

agent = ChatAgent(
    system_message="Reply in one sentence.",
    model=model,
)
response = agent.step("Hello from PZERO")
print(response.msg.content)

url is the /v1 root, not /v1/chat/completions. Pass the catalog id as-is. Keep api_mode at the default chat_completions unless you have verified the Responses path.

Get a key: https://pzero.studio/agents (sign-in free; min top-up 1 USDC on Base; no starter credits). Live text ids: GET https://api.pzero.studio/v1/models (public, no key). Default landing model: deepseek-v4-flash.

Smoke against the same host CAMEL will call:

curl -sS -X POST "https://api.pzero.studio/v1/chat/completions" \
  -H "Authorization: Bearer $PZERO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello from PZERO"}],"stream":false}'

I am not asking for a bundled ModelPlatformType.PZERO. The existing OpenAI-compatible seam is enough.

Alternatives

A first-party platform enum next to OpenRouter / Groq. Nice later. Not required for users today.

Pointing at Venice's own host (https://api.venice.ai/api/v1). Wrong product. PZERO is a prepaid marketplace in front of that upstream.

Additional context

Every AI Credit is at least 20% off $1 list. Usage is paid. Do not start implementation on my behalf until the board says Ready; the snippet is for users today.

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