Working config (from_openai + Mode.JSON + base_url /v1)
instructor.from_provider("openai/...") hits first-party OpenAI. Default OpenAI mode is tool calling. Mode.RESPONSES_TOOLS is the Responses API.
A Chat Completions host whose public catalog is GET https://api.pzero.studio/v1/models (no key) fits from_openai if base_url is the /v1 root and mode is Mode.JSON (response_format json_object).
import instructor
from openai import OpenAI
from pydantic import BaseModel
class Reply(BaseModel):
text: str
client = instructor.from_openai(
OpenAI(api_key="<Bearer key for that host>", base_url="https://api.pzero.studio/v1"),
mode=instructor.Mode.JSON,
)
reply = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Say hello as JSON"}],
response_model=Reply,
)
Keep embeddings and multimodal off this host.
Working config (
from_openai+Mode.JSON+base_url/v1)instructor.from_provider("openai/...")hits first-party OpenAI. Default OpenAI mode is tool calling.Mode.RESPONSES_TOOLSis the Responses API.A Chat Completions host whose public catalog is
GET https://api.pzero.studio/v1/models(no key) fitsfrom_openaiifbase_urlis the/v1root and mode isMode.JSON(response_formatjson_object).Keep embeddings and multimodal off this host.