# nodus.llm

> OpenAI- and Anthropic-compatible inference (resources.md §4.5, §4.6, ADR-049, ADR-100).

Source: https://nodus-platform-site.pages.dev/docs/reference/python/nodus-llm/
Build revision: 211ad9f836655b1c3a2668c4693e442471f28614

<!-- Generated by scripts/gen-reference.mjs from the SDK docstrings (griffe). Do not edit: run make gen. -->

OpenAI- and Anthropic-compatible inference (resources.md §4.5, §4.6, ADR-049, ADR-100).

`nodus.llm.openai()` and `nodus.llm.anthropic()` return the official clients pointed at the Nodus inference data plane with your key, so every stock SDK feature works. Inside a Nodus container they use `OPENAI_BASE_URL` and `ANTHROPIC_BASE_URL`, the loopback proxy that adds the attempt’s token and bills the owning run; name an endpoint there with `model="endpoint/<name>"`. Requires the `openai` or `anthropic` extra: `pip install "nodus-compute[openai]"`.

## `InferenceEndpoint`

```python
class InferenceEndpoint(obj: Obj) -> None
```

A named access policy (limits, allowed keys, cost cap) over a catalog Model, with its own base URL.

### `InferenceEndpoint.anthropic`

```python
anthropic(**kwargs: Any) -> Any
```

### `InferenceEndpoint.base_url`

Type: `str | None`

### `InferenceEndpoint.create`

```python
create(name: str, model: str, *, rpm: int | None = None, tpm: int | None = None, max_concurrent: int | None = None, allowed_keys: list[str] | None = None, max_cost: Any = None, project: str | None = None) -> _InferenceEndpoint
```

### `InferenceEndpoint.from_name`

```python
from_name(name: str, project: str | None = None) -> _InferenceEndpoint
```

### `InferenceEndpoint.name`

Type: `str`

### `InferenceEndpoint.openai`

```python
openai(**kwargs: Any) -> Any
```

### `InferenceEndpoint.usage`

```python
usage() -> View
```

Requests, errors, tokens and cost over the last 24 hours (refreshed every minute).

## `anthropic`

```python
anthropic(endpoint: str | None = None, project: str | None = None, **kwargs: Any) -> Any
```

An `anthropic.Anthropic` client for `/v1/messages` on the inference data plane.

## `async_anthropic`

```python
async_anthropic(endpoint: str | None = None, project: str | None = None, **kwargs: Any) -> Any
```

## `async_openai`

```python
async_openai(endpoint: str | None = None, project: str | None = None, **kwargs: Any) -> Any
```

## `openai`

```python
openai(endpoint: str | None = None, project: str | None = None, **kwargs: Any) -> Any
```

An `openai.OpenAI` client for the inference data plane (or a named InferenceEndpoint).
