Settings for OpenAIApiEndpoint. Values fall back through three levels: document → SDK → built-in default. Writes target the document only when set on a document’s settings, otherwise the SDK globally when set on SdkSettings.

Tags: Vision

from nutrient_sdk import OpenAIApiEndpointSettings

Construction

OpenAIApiEndpointSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.

# Per-document override
with Document.open("input.pdf") as doc:
settings = doc.settings.open_ai_api_endpoint_settings
settings.some_field = new_value # mutate fields directly
# SDK-wide default (applies to all documents)
SdkSettings.open_ai_api_endpoint_settings.some_field = new_value

Settings are configured by writing to fields on the returned object. The settings property itself cannot be reassigned — doc.settings.open_ai_api_endpoint_settings = other_settings is rejected.

Properties

api_endpoint

@property
def api_endpoint(self) -> str
@api_endpoint.setter
def api_endpoint(self, value: str) -> None

API endpoint URL for OpenAI-compatible chat completions

Type: str

Default: "https://api.openai.com/v1"


api_key

@property
def api_key(self) -> str
@api_key.setter
def api_key(self, value: str) -> None

OpenAI API key for authentication.

Type: str

Default: string.Empty


batch_size

@property
def batch_size(self) -> int
@batch_size.setter
def batch_size(self, value: int) -> None

Number of zone images to include per VLM API call.

Type: int

Default: 8


classification_strategy

@property
def classification_strategy(self) -> VlmClassificationStrategy
@classification_strategy.setter
def classification_strategy(self, value: VlmClassificationStrategy) -> None

Strategy for how zones are sent to the VLM for classification.

Type: VlmClassificationStrategy

Default: VlmClassificationStrategy.MultiZone


max_concurrency

@property
def max_concurrency(self) -> int
@max_concurrency.setter
def max_concurrency(self, value: int) -> None

Maximum number of concurrent VLM API calls.

Type: int

Default: 4


max_tokens

@property
def max_tokens(self) -> int
@max_tokens.setter
def max_tokens(self, value: int) -> None

Maximum tokens in response (-1 = unlimited)

Type: int

Default: -1


model

@property
def model(self) -> str
@model.setter
def model(self, value: str) -> None

Model identifier to use for classification

Type: str

Default: "gpt-5.1"


send_full_page_reference

@property
def send_full_page_reference(self) -> bool
@send_full_page_reference.setter
def send_full_page_reference(self, value: bool) -> None

Whether to send the full page image as reference context alongside cropped zones. Only used when UseZoneCropping is true.

Type: bool

Default: false


stream

@property
def stream(self) -> bool
@stream.setter
def stream(self, value: bool) -> None

Whether to stream responses from the API

Type: bool

Default: false


system_prompt

@property
def system_prompt(self) -> str
@system_prompt.setter
def system_prompt(self, value: str) -> None

Optional custom system prompt for zone classification. When empty, the module uses a default prompt based on the ClassificationStrategy.

Type: str

Default: string.Empty


temperature

@property
def temperature(self) -> float
@temperature.setter
def temperature(self, value: float) -> None

Temperature for response generation (0.0 = deterministic, 1.0 = creative)

Type: float

Default: 0.7