> For the complete documentation index, see [llms.txt](https://docs.luojixiangliang.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luojixiangliang.com/reference/openai-api-can-kao-wen-dang/yin-qing.md).

# 引擎

{% hint style="warning" %}
此接口已被废弃，请改用它们的替代品——模型。[了解更多](/reference/openai-api-can-kao-wen-dang/mo-xing.md)。
{% endhint %}

### 获取引擎列表

```
GET https://api.openai.com/v1/engines
```

列出当前可用（非优化）的模型，并提供每个模型的基本信息，例如所有者和可用性。

#### 请求示例

{% tabs %}
{% tab title="curl" %}
{% code lineNumbers="true" %}

```sh
curl https://api.openai.com/v1/engines \
  -H "Authorization: Bearer $OPENAI_API_KEY"

```

{% endcode %}
{% endtab %}

{% tab title="python" %}
{% code lineNumbers="true" %}

```python
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
openai.Engine.list()

```

{% endcode %}
{% endtab %}

{% tab title="node.js" %}
{% code lineNumbers="true" %}

```javascript
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.listEngines();

```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="返回结果" lineNumbers="true" %}

```json
{
  "data": [
    {
      "id": "engine-id-0",
      "object": "engine",
      "owner": "organization-owner",
      "ready": true
    },
    {
      "id": "engine-id-2",
      "object": "engine",
      "owner": "organization-owner",
      "ready": true
    },
    {
      "id": "engine-id-3",
      "object": "engine",
      "owner": "openai",
      "ready": false
    },
  ],
  "object": "list"
}

```

{% endcode %}

### 获取引擎详细信息

```
GET https://api.openai.com/v1/engines/{engine_id}
```

检索模型实例，提供基本信息，例如所有者和可用性。

#### 路径参数

* engine\_id 字符串 必填项 此请求使用的引擎的ID

#### 请求示例

{% tabs %}
{% tab title="curl" %}
{% code lineNumbers="true" %}

```sh
curl https://api.openai.com/v1/engines/text-davinci-003 \
  -H "Authorization: Bearer $OPENAI_API_KEY"

```

{% endcode %}
{% endtab %}

{% tab title="python" %}
{% code lineNumbers="true" %}

```python
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
openai.Engine.retrieve("text-davinci-003")

```

{% endcode %}
{% endtab %}

{% tab title="node.js" %}
{% code lineNumbers="true" %}

```javascript
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.retrieveEngine("text-davinci-003");

```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="返回结果" lineNumbers="true" %}

```json
{
  "id": "text-davinci-003",
  "object": "engine",
  "owner": "openai",
  "ready": true
}

```

{% endcode %}
