> This page is for version v0.25.0.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.25.0: https://docs.nvidia.com/nemo/guardrails/v0.25.0/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.

# nemoguardrails.server.experimental.providers.openai.integration

Compose explicit OpenAI operation sets and provider-native errors.

## Module Contents

### Functions

| Name                                                                                                                                | Description                                                              |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`create_openai_chat_integration`](#nemoguardrails-server-experimental-providers-openai-integration-create_openai_chat_integration) | Create a Chat-only OpenAI instance with an explicitly reviewed endpoint. |
| [`create_openai_chat_router`](#nemoguardrails-server-experimental-providers-openai-integration-create_openai_chat_router)           | Create the private buffered and streaming OpenAI Chat proxy surface.     |
| [`create_openai_integration`](#nemoguardrails-server-experimental-providers-openai-integration-create_openai_integration)           | Create an OpenAI instance with the selected built-in guard bindings.     |

### Data

[`OpenAIOperation`](#nemoguardrails-server-experimental-providers-openai-integration-OpenAIOperation)

### API

```python
nemoguardrails.server.experimental.providers.openai.integration.create_openai_chat_integration(
    instance_id: str = 'openai',
    base_url: str | None = None,
    mount_path: str = '',
    endpoint: nemoguardrails.server.experimental.provider.endpoint.GuardedJsonEndpoint | None = None
) -> nemoguardrails.server.experimental.provider.integration.ProviderIntegration
```

Create a Chat-only OpenAI instance with an explicitly reviewed endpoint.

Omitting `endpoint` selects the strict OpenAI Chat boundary through
`create_openai_integration`. A trusted application may instead supply
an OpenAI-wire-compatible dialect endpoint; it must use the OpenAI error
mapping. Other instances are unaffected. Unselected routes retain the
application's passthrough behavior.

```python
nemoguardrails.server.experimental.providers.openai.integration.create_openai_chat_router(
    checker: nemoguardrails.server.experimental._content_checker.ContentChecker,
    dispatch: nemoguardrails.server.experimental._http_kernel.HttpDispatch,
    stream_dispatch: nemoguardrails.server.experimental._streaming_http.StreamingHttpDispatch | None = None,
    reserved_routes: collections.abc.Mapping[str, collections.abc.Collection[str]] | None = None,
    max_request_body_bytes: int = DEFAULT_MAX_REQUEST_BODY_BYTES,
    max_response_body_bytes: int = DEFAULT_MAX_RESPONSE_BODY_B...,
    endpoint: nemoguardrails.server.experimental.provider.endpoint.GuardedJsonEndpoint | None = None
) -> fastapi.APIRouter
```

Create the private buffered and streaming OpenAI Chat proxy surface.

A trusted application may explicitly supply a reviewed OpenAI-wire-compatible
endpoint, such as the LiteLLM subset. Omitting it retains the OpenAI policy.
This does not detect a backend, load a contract, or select a dialect from
request data. The supplied endpoint must use the OpenAI error mapping.

```python
nemoguardrails.server.experimental.providers.openai.integration.create_openai_integration(
    instance_id: str = 'openai',
    base_url: str | None = None,
    mount_path: str = '',
    operations: collections.abc.Sequence[nemoguardrails.server.experimental.providers.openai.integration.OpenAIOperation] = ('chat_completions', 'respo...
) -> nemoguardrails.server.experimental.provider.integration.ProviderIntegration
```

Create an OpenAI instance with the selected built-in guard bindings.

`operations` is a nonempty sequence of unique names, in binding order.
The fixed default selects Chat Completions and Responses; it does not mean
all operations a future version might support. A bare string is invalid.

Selection installs guard bindings, not a route allowlist. Unselected routes
retain the application's passthrough behavior and are not thereby guarded.
These are strict OpenAI boundaries: an upstream URL does not select a
dialect. Trusted applications can customize explicit endpoint bindings.

**Raises:**

* `TypeError`: `operations` is not a sequence of operation names.
* `ValueError`: The selection is empty, unknown, or contains duplicates.

```python
nemoguardrails.server.experimental.providers.openai.integration.OpenAIOperation = Literal['chat_completions', 'responses']
```

Built-in operation names accepted by the OpenAI integration factory.