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

# NewAPIs Image

> Generate and edit images with NewAPIs, including asynchronous Responses API image tasks.

`newapi-image` 默认调用 `https://api.newapi.si`，并从 `NEWAPI_API_KEY` 读取鉴权信息。

## 支持的命令

| 命令 | API | 用途 |
| - | - | - |
| `models` | `GET /v1/models` | 查询可用模型 |
| `generate` | `POST /v1/images/generations` | 生成图片 |
| `edit` | `POST /v1/images/edits` | 编辑图片 |
| `responses-create` | `POST /v1/responses` | 创建异步图片任务 |
| `responses-get` | `GET /v1/responses/{response_id}` | 查询异步图片任务 |

## 调用示例

```bash theme={null}
node scripts/newapi-image.mjs models
node scripts/newapi-image.mjs generate --json image-request.json
node scripts/newapi-image.mjs edit --json edit-request.json
node scripts/newapi-image.mjs responses-create --json responses-request.json
node scripts/newapi-image.mjs responses-get --id resp_xxx
```

创建任务后保存返回的任务 ID，再使用对应查询命令获取状态。长任务不要保持单次 HTTP 请求等待。


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