# pllm.official Python API

Public objects, practical usage, and research context for pllm.official.

[View canonical HTML](https://pllm.run/sdk/reference/python/pllm/official/)

Document ID: `pllm.docs.reference.python.pllm.official`  
Release: `0.1.0`

Official integration factories construct OpenAI SDK clients that route requests through PLLM's trusted local client transport. Presence documents API availability, not complete model, security, or deployment coverage; check [implementation status](/sdk/reference/status/) before relying on a path.

## Research context

This API is project infrastructure rather than an implementation of one specific paper. Relevant method pages link their primary sources separately.

## Python SDK example

The example performs a bounded offline task and checks an observable result. It does not download a checkpoint or contact a provider.

```python
import pllm.official as official

client = official.create_openai_client()
try:
    base_url = str(client.base_url)
finally:
    client.close()
assert base_url == "https://pllm.local/v1/"
```

API: [`pllm.official`](/sdk/reference/python/pllm/official/#objects-and-signatures)

## Objects and signatures

### `create_async_openai_client`

Performs the create async openai client operation for the workflow where official integration factories construct openai sdk clients that route requests through pllm's trusted local client transport.

- Canonical object: `pllm.runtime.official.create_async_openai_client`
- Kind: `function`
- Signature/type: `(*, gateway_url: 'str \| None' = None, gateway_api_key: 'str \| None' = None, preparation_url: 'str \| None' = None, preparation_api_key: 'str \| None' = None, api_key: 'str' = 'pllm-local-transport', base_url: 'str' = 'https://pllm.local/v1', session_transport: 'str \| None' = None, correlation_mode: 'str \| None' = None, correlation_prefetch: 'int \| None' = None, prepared_inventory_rows: 'int \| None' = None, token_cache_size: 'int \| None' = None, bundle_cache_mode: 'str \| None' = None, bundle_cache_dir: 'str \| None' = None, tenseal_path: 'str \| None' = None, **client_kwargs: 'Any')`
- Public exports: `pllm.create_async_openai_client`, `pllm.official.create_async_openai_client`

### `create_openai_client`

Create the installed official ``openai.OpenAI`` client over PLLM runtime.

- Canonical object: `pllm.runtime.official.create_openai_client`
- Kind: `function`
- Signature/type: `(*, gateway_url: 'str \| None' = None, gateway_api_key: 'str \| None' = None, preparation_url: 'str \| None' = None, preparation_api_key: 'str \| None' = None, api_key: 'str' = 'pllm-local-transport', base_url: 'str' = 'https://pllm.local/v1', session_transport: 'str \| None' = None, correlation_mode: 'str \| None' = None, correlation_prefetch: 'int \| None' = None, prepared_inventory_rows: 'int \| None' = None, token_cache_size: 'int \| None' = None, bundle_cache_mode: 'str \| None' = None, bundle_cache_dir: 'str \| None' = None, tenseal_path: 'str \| None' = None, **client_kwargs: 'Any')`
- Public exports: `pllm.create_openai_client`, `pllm.official.create_openai_client`
