> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Nebius Token Factory

> Use Nebius Token Factory models with Agno agents.

Nebius Token Factory provides OpenAI-compatible inference for hosted models. Browse the [model catalog](https://tokenfactory.nebius.com/), query the [model-list API](https://docs.tokenfactory.nebius.com/api-reference/examples/list-of-models), and check [function-calling support](https://docs.tokenfactory.nebius.com/ai-models-inference/function-calling) before selecting a model.

## Authentication

Create an API key in the [Nebius Token Factory console](https://tokenfactory.nebius.com/?modals=create-api-key), then export the key and a current text-generation model ID.

```bash macOS / Linux theme={null}
export NEBIUS_API_KEY="your_nebius_api_key"
export NEBIUS_MODEL_ID="your_current_text_model_id"
```

```powershell Windows theme={null}
$Env:NEBIUS_API_KEY="your_nebius_api_key"
$Env:NEBIUS_MODEL_ID="your_current_text_model_id"
```

## Example

Use `Nebius` with your `Agent`:

```python agent.py theme={null}
import os

from agno.agent import Agent
from agno.models.nebius import Nebius

agent = Agent(
    model=Nebius(
        id=os.environ["NEBIUS_MODEL_ID"],
    ),
    markdown=True
)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")
```

See the [Nebius usage examples](https://agno-v2.mintlify.site/models/providers/gateways/nebius/usage/basic-stream.md).

> [!WARNING]
>
> The pinned Agno 2.7.2 default, `openai/gpt-oss-20b`, is retired from serverless inference. Set `id` to an explicit current text-generation model ID from the [Nebius model-list API](https://docs.tokenfactory.nebius.com/api-reference/examples/list-of-models).

## Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"openai/gpt-oss-20b"` | The id of the Nebius model to use |
| `name` | `str` | `"Nebius"` | The name of the model |
| `provider` | `str` | `"Nebius"` | The provider of the model |
| `api_key` | `Optional[str]` | `None` | The API key for Nebius (defaults to NEBIUS\_API\_KEY env var) |
| `base_url` | `str` | `"https://api.tokenfactory.nebius.com/v1/"` | The base URL for the Nebius API |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.