> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Agno

> 在 Agno agent 中使用 TokenLab 模型

## 概覽

Agno 可以將 TokenLab 作為 OpenAI 相容的模型提供者，用於 agent 和工作流程。

<Note>
  **類型**: Agent 框架

  **主要路徑**: OpenAI 相容的聊天補全 (chat completions)

  **支援信心**: 支援的路徑
</Note>

## 環境變數

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
```

## TokenLab 模型封裝 (Model Wrapper)

如果您的 Agno 版本包含 TokenLab 模型封裝：

```python theme={null}
from agno.agent import Agent
from agno.models.tokenlab import TokenLab

agent = Agent(model=TokenLab(id="gpt-5.4-mini"))
agent.print_response("Give me a concise project risk checklist.")
```

部分 Agno 建置版本也支援模型字串：

```python theme={null}
agent = Agent(model="tokenlab:gpt-5.4-mini")
```

## OpenAI 相容的後備方案 (Fallback)

如果您的版本尚未包含 TokenLab，請使用 Agno 的 OpenAI 相容模型路徑，設定如下：

* Base URL: `https://api.tokenlab.sh/v1`
* API key: `TOKENLAB_API_KEY`
* Model: `gpt-5.4-mini`

## 模型建議

預設 agent 請使用 `gpt-5.4-mini`，需要更深層推理時請使用 `gpt-5.4` 或 `claude-sonnet-5`，若需要更快的迴圈處理則建議使用 `deepseek-v4-flash`。
