> 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.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.http.runtime

Construction helpers for managed outbound HTTP clients.

## Module Contents

### Functions

| Name                                                                    | Description                                                          |
| ----------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [`create_http_client`](#nemoguardrails-http-runtime-create_http_client) | Create a transport-neutral HTTP client with optional retry behavior. |

### API

```python
nemoguardrails.http.runtime.create_http_client(
    httpx_client: httpx.AsyncClient | None = None,
    timeout: float | None = 30.0,
    limits: httpx.Limits | None = None,
    retry_policy: nemoguardrails.http.retry.RetryPolicy | None = None,
    follow_redirects: bool = False,
    tls: nemoguardrails.http.types.HTTPTLSConfig | None = None
) -> nemoguardrails.http.client.ClosableHTTPClient
```

Create a transport-neutral HTTP client with optional retry behavior.

When `httpx_client` is provided, it remains caller-owned and `timeout`,
`limits`, `follow_redirects`, and `tls` must retain their defaults.
`retry_policy` is still applied when supplied.

**Parameters:**

**`httpx_client`** `httpx.AsyncClient | None` — default: None

Optional caller-owned HTTPX client.

---

**`timeout`** `float | None` — default: 30.0

Total timeout for a client created by this function.

---

**`limits`** `httpx.Limits | None` — default: None

Connection-pool limits for a client created by this function.

---

**`retry_policy`** `RetryPolicy | None` — default: None

Optional policy applied to created or injected clients.

---

**`follow_redirects`** `bool` — default: False

Whether a client created by this function follows
redirects.

---

**`tls`** `HTTPTLSConfig | None` — default: None

TLS settings for a client created by this function.

---

**Returns:** `ClosableHTTPClient`

A closable transport-neutral HTTP client.

**Raises:**

* `ValueError`: If non-default owned-client options are supplied with an
  injected client.