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

# OpenAI Like

> 了解如何在 Agno 中使用类似 OpenAI 的模型。

许多提供商如 Together、Groq、Nebius、Sambanova、xAI 等都支持 OpenAI API 格式。通过替换 `base_url` 来使用 `OpenAILike` 模型访问它们。

## 示例

<CodeGroup>
  ```python agent.py theme={null}
  from os import getenv
  from agno.agent import Agent, RunResponse
  from agno.models.openai.like import OpenAILike

  agent = Agent(
      model=OpenAILike(
          id="mistralai/Mixtral-8x7B-Instruct-v0.1",
          api_key=getenv("TOGETHER_API_KEY"),
          base_url="https://api.together.xyz/v1",
      )
  )

  # 在终端打印响应
  agent.print_response("Share a 2 sentence horror story.")
  ```
</CodeGroup>

## 参数

<Snippet file="model-openai-like-reference.mdx" />

`OpenAILike` 也支持 [OpenAIChat](/reference/models/openai) 的所有参数。
