> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to All-Images AI

The All-Images AI connector lets your AI agent act in each user's All-Images AI account. Each user connects their own All-Images AI API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 14 tools.

**Authentication:** API Key
**Categories:** AI, Media
**Tools:** 14: 7 read, 5 write, 2 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=ALLIMAGESAI)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the All-Images AI connection

   In **AgentKit > Connections**, create an All-Images AI connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'allimagesai'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize All-Images AI:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'allimagesai_api_key_check',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "allimagesai"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize All-Images AI:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="allimagesai_api_key_check",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their All-Images AI credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'allimagesai_api_key_check',
  toolInput: {},
  connector: 'allimagesai',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="allimagesai_api_key_check",
    tool_input={},
    connection_name="allimagesai",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `allimagesai_api_key_check`

Check API Key · Read-only

Check that the All-Images.ai API key is valid.
Returns the email and name of the account the key belongs to.
Use this to confirm the connection works.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `allimagesai_credits_get`

Get Credits · Read-only

Get the All-Images.ai account's credit balance.
Returns the remaining credits for image purchases and generations.
Use this before buying images or creating generations.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `allimagesai_generation_get`

Get Image Generation · Read-only

Get one image generation.
Returns its id, name, prompt, params, status (0 created, 1 pending, 2 processing, 3 done, 4 error), progress and the generated images with their IDs and URLs.
Use this to poll a generation until status is 3 (done), then buy an image with allimagesai_image_buy.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `generation_id` (`string`, required): ID of the image generation, from allimagesai_generations_list or the create response. Example: 65921cb1-111d-4cca-a554-809b61f842b4.

Example input: `{"generation_id":"<generation_id>"}`

### `allimagesai_generations_list`

List Image Generations · Read-only

List the account's image generations, optionally filtered by name or tag.
Returns filteredResults and prints, each with id, name, prompt, status (0 created, 1 pending, 2 processing, 3 done, 4 error), images, tags and metadata.
Use this to find a generation ID. Use allimagesai_generation_get for one generation.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): Number of results to return. Example: 20.
- `name` (`string`, optional): Only generations whose name matches this text. Example: Dog in the park.
- `offset` (`integer`, optional): Number of results to skip, for paging. Example: 0.
- `sort` (`string`, optional): Sort order, as accepted by the All-Images API (for example createdAt). Example: createdAt.
- `tag` (`string`, optional): Only generations with this tag. Example: blog.

Example input: `{}`

### `allimagesai_images_downloaded_list`

List Downloaded Images · Read-only

List the images the account has already bought or downloaded, optionally within a date range.
Returns filteredResults and the images with id and URLs.
Use this to find images you own. Use allimagesai_images_search to find new ones.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `after_created_at` (`string`, optional): Only images downloaded after this ISO 8601 date-time. Example: 2026-01-01T00:00:00Z.
- `before_created_at` (`string`, optional): Only images downloaded before this ISO 8601 date-time. Example: 2026-02-01T00:00:00Z.
- `limit` (`integer`, optional): Number of results to return. Example: 20.
- `offset` (`integer`, optional): Number of results to skip, for paging. Example: 0.
- `sort` (`string`, optional): Sort order, as accepted by the All-Images API (for example createdAt). Example: createdAt.

Example input: `{}`

### `allimagesai_images_search`

Search Stock Images · Read-only

Search the All-Images.ai library of AI-generated stock photos by keywords.
Returns filteredResults (total matches) and images with id, title and preview URL.
Use this to find an image to buy with allimagesai_image_buy. Use allimagesai_images_downloaded_list for images you already own.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `filter_free` (`boolean`, optional): Only return free images. Example: false.
- `limit` (`integer`, optional): Number of results to return. Example: 20.
- `offset` (`integer`, optional): Number of results to skip, for paging. Example: 0.
- `search` (`string`, optional): Keywords to search for. Example: office team meeting.
- `sort` (`string`, optional): Sort order, as accepted by the All-Images API (for example createdAt). Example: createdAt.

Example input: `{}`

### `allimagesai_webhook_get`

Get Webhook · Read-only

Get a webhook registered on the API key.
Returns its id, URL and events.
The ID comes from allimagesai_webhook_subscribe.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `webhook_id` (`string`, required): Webhook ID returned by allimagesai_webhook_subscribe. Example: 6592a0b1-2c3d-4e5f-8a9b-0c1d2e3f4a5b.

Example input: `{"webhook_id":"<webhook_id>"}`

### `allimagesai_generation_create`

Create Image Generation · Write

Start an AI image generation that proposes 4 images from a description. Uses credits. Runs in the background.
Returns the new generation with its id and status.
Poll allimagesai_generation_get until status is 3 (done), or subscribe a webhook with allimagesai_webhook_subscribe.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `mode` (`string`, required): simple: a plain description, optionally tuned with params and optimize_prompt. advanced: a raw Midjourney imagine prompt, parameters included (for example --aspect 3:2). Example: simple. One of: `simple`, `advanced`.
- `name` (`string`, required): Name for the generation, used to find it later. Example: Dog in the park.
- `prompt` (`string`, required): Image description (simple mode, no Midjourney parameters) or full Midjourney prompt (advanced mode), up to 4096 characters. Example: a dog playing in a park.
- `additional_prompt` (`string`, optional): Extra text added at the start of the prompt and left untouched by prompt optimization, up to 1024 characters. Example: watercolor style.
- `metadata` (`object`, optional): Custom key-value data stored with the generation and sent back in webhooks. Example: {"post_id": "123"}
- `optimize_prompt` (`boolean`, optional): Simple mode: let All-Images rewrite the description into a richer prompt. Example: true.
- `params` (`array`, optional): Simple-mode options as name/value pairs. Names: templatePrompt (realisticQuality or realisticManuel), format (1:1, 3:2, 2:3, 4:7, 7:4, 5:4, 4:5, 16:9, 9:16), weather (sunny, cloudy, foggy, rainy, thunderstorm, snowy), time (sunrise, morning, afternoon, sunset, evening, golden hour, night, midnight), camera (a camera name), chaos (0 to 100), stylize (0 to 1000), interdiction (comma-separated things to keep out of the image), plus angle, photographe, sujetMode, version and fromImageUrl. Values are strings. Example: [{"name": "format", "value": "16:9"}, {"name": "weather", "value": "sunny"}]
- `process_mode` (`string`, optional): fast or relax generation; only for Dedicated plan users. Defaults to fast. Example: fast. One of: `fast`, `relax`.
- `tags` (`array`, optional): Tags to find the generation by later. Example: ["blog", "pets"]

Example input: `{"mode":"simple","name":"<name>","prompt":"<prompt>"}`

### `allimagesai_generation_retry`

Retry Image Generation · Write

Restart a generation that ended in error.
Returns the generation with its new status.
Change its prompt first with allimagesai_generation_update if the error came from the description.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `generation_id` (`string`, required): ID of the image generation, from allimagesai_generations_list or the create response. Example: 65921cb1-111d-4cca-a554-809b61f842b4.

Example input: `{"generation_id":"<generation_id>"}`

### `allimagesai_generation_update`

Update Image Generation · Write

Change a generation's name, prompt, options, tags or metadata. Not allowed while it is pending or in progress.
Returns the updated generation.
Use this to fix a failed generation before allimagesai_generation_retry. Only the fields you set are sent.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `generation_id` (`string`, required): ID of the image generation, from allimagesai_generations_list or the create response. Example: 65921cb1-111d-4cca-a554-809b61f842b4.
- `additional_prompt` (`string`, optional): Extra text added at the start of the prompt and left untouched by prompt optimization, up to 1024 characters. Example: watercolor style.
- `metadata` (`object`, optional): Custom key-value data stored with the generation and sent back in webhooks. Example: {"post_id": "123"}
- `mode` (`string`, optional): simple: a plain description, optionally tuned with params and optimize_prompt. advanced: a raw Midjourney imagine prompt, parameters included (for example --aspect 3:2). Example: simple. One of: `simple`, `advanced`.
- `name` (`string`, optional): Name for the generation, used to find it later. Example: Dog in the park.
- `optimize_prompt` (`boolean`, optional): Simple mode: let All-Images rewrite the description into a richer prompt. Example: true.
- `params` (`array`, optional): Simple-mode options as name/value pairs. Names: templatePrompt (realisticQuality or realisticManuel), format (1:1, 3:2, 2:3, 4:7, 7:4, 5:4, 4:5, 16:9, 9:16), weather (sunny, cloudy, foggy, rainy, thunderstorm, snowy), time (sunrise, morning, afternoon, sunset, evening, golden hour, night, midnight), camera (a camera name), chaos (0 to 100), stylize (0 to 1000), interdiction (comma-separated things to keep out of the image), plus angle, photographe, sujetMode, version and fromImageUrl. Values are strings. Example: [{"name": "format", "value": "16:9"}, {"name": "weather", "value": "sunny"}]
- `process_mode` (`string`, optional): fast or relax generation; only for Dedicated plan users. Defaults to fast. Example: fast. One of: `fast`, `relax`.
- `prompt` (`string`, optional): Image description (simple mode, no Midjourney parameters) or full Midjourney prompt (advanced mode), up to 4096 characters. Example: a dog playing in a park.
- `tags` (`array`, optional): Tags to find the generation by later. Example: ["blog", "pets"]

Example input: `{"generation_id":"<generation_id>"}`

### `allimagesai_image_buy`

Buy Image · Write

Buy a stock image and get a direct public link to the full-size file. Uses credits the first time; buying the same image again is free.
Returns the image's public download URL.
Use allimagesai_images_search to find the image ID.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `id` (`string`, required): ID of the image to buy, from allimagesai_images_search or a generation's images. Example: 65921cb1-111d-4cca-a554-809b61f842b4.

Example input: `{"id":"<id>"}`

### `allimagesai_webhook_subscribe`

Subscribe Webhook · Write

Register a URL that receives image generation events for this API key.
Returns the webhookId.
Use allimagesai_webhook_unsubscribe to remove it.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): HTTPS URL that receives the webhook POSTs. Example: https://example.com/hooks/all-images.
- `events` (`array`, optional): Events to send: test, print.created, print.active, print.progress, print.failed, print.completed. Defaults to print.failed and print.completed. Example: ["print.completed", "print.failed"]

Example input: `{"url":"<url>"}`

### `allimagesai_generations_delete`

Delete Image Generations · Destructive

Delete one or more image generations.
Returns a confirmation.
This cannot be undone. Images already bought stay available.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `print_ids` (`array`, required): IDs of the generations to delete, from allimagesai_generations_list. Example: ["65921cb1-111d-4cca-a554-809b61f842b4"]

Example input: `{"print_ids":["65921cb1-111d-4cca-a554-809b61f842b4"]}`

### `allimagesai_webhook_unsubscribe`

Unsubscribe Webhook · Destructive

Remove a webhook from the API key so it stops receiving events.
Returns a confirmation.
The ID comes from allimagesai_webhook_subscribe.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `webhook_id` (`string`, required): Webhook ID returned by allimagesai_webhook_subscribe. Example: 6592a0b1-2c3d-4e5f-8a9b-0c1d2e3f4a5b.

Example input: `{"webhook_id":"<webhook_id>"}`

## Related

Other AI connectors ([all 216](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
