> ## 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` uses `https://api.newapi.si` by default and reads authentication information from `NEWAPI_API_KEY`.

## Supported Commands

| Command | API | Purpose |
| - | - | - |
| `models` | `GET /v1/models` | List available models |
| `generate` | `POST /v1/images/generations` | Generate images |
| `edit` | `POST /v1/images/edits` | Edit images |
| `responses-create` | `POST /v1/responses` | Create asynchronous image tasks |
| `responses-get` | `GET /v1/responses/{response_id}` | Query asynchronous image tasks |

## Usage Examples

```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
```

After creating a task, save the returned task ID, then use the corresponding query command to get its status. For long-running tasks, do not keep a single HTTP request waiting.


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