# 引擎

{% 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.luojixiangliang.com/reference/openai-api-can-kao-wen-dang/yin-qing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
