> ## 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.

# Tuning Engines

> Use Tuning Engines with Agno through an OpenAI-compatible governed endpoint.

Tuning Engines exposes an OpenAI-compatible endpoint for teams that want Agno agents to run through a governed AI control plane. Agno owns the agent behavior, tools, memory, and orchestration, while Tuning Engines centralizes model access, policy checks, audit logs, traces, and usage/cost reporting.

## Authentication

Create a Tuning Engines inference key and enable the model alias you want the agent to use.

```bash Mac theme={null}
export TUNING_ENGINES_API_KEY=sk-te-your-inference-key
export TUNING_ENGINES_MODEL=your-model-alias
# Optional, only when using a custom host:
export TUNING_ENGINES_BASE_URL=https://api.tuningengines.com/v1
```

```bash Windows theme={null}
setx TUNING_ENGINES_API_KEY sk-te-your-inference-key
setx TUNING_ENGINES_MODEL your-model-alias
:: Optional, only when using a custom host:
setx TUNING_ENGINES_BASE_URL https://api.tuningengines.com/v1
```

## Example

Install the `openai` package:

```shell theme={null}
uv pip install -U agno openai
```

Use Agno's `TuningEngines` model provider:

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

from agno.agent import Agent
from agno.models.tuning_engines import TuningEngines

agent = Agent(
    model=TuningEngines(
        id=getenv("TUNING_ENGINES_MODEL", "your-model-alias"),
    ),
    markdown=True,
)

agent.print_response("Share a short checklist for running production AI agents.", stream=True)
```

## Params

| Parameter | Type | Description | Default |
| - | - | - | - |
| `id` | `str` | Model alias enabled in Tuning Engines | `"gpt-4o"` |
| `api_key` | `Optional[str]` | Tuning Engines inference key, read from `TUNING_ENGINES_API_KEY` | `None` |
| `base_url` | `str` | Tuning Engines OpenAI-compatible API endpoint | `TUNING_ENGINES_BASE_URL` or `"https://api.tuningengines.com/v1"` |

`TuningEngines` extends `OpenAILike`, so it supports the same OpenAI-compatible model parameters documented in [OpenAI Like](https://agno-v2.mintlify.site/models/providers/openai-like.md).

> [!NOTE]
>
> View a runnable example [here](https://agno-v2.mintlify.site/examples/models/tuning-engines/basic.md).


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