---
canonical_url: "https://docs.composio.dev/toolkits/ngram"
markdown_url: "https://docs.composio.dev/toolkits/ngram.md"
product: "platform"
version: null
last_updated: null
---

# Ngram

Ngram creates AI-generated videos and images, manages rendering jobs, and delivers completion events through webhooks.

- **Category:** ai content generation
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 14
- **Triggers:** 0
- **Slug:** `NGRAM`
- **Version:** 00000000_00

## Tools

### Cancel Video

**Slug:** `NGRAM_CANCEL_VIDEO`

Irreversibly request cancellation of an in-progress Ngram video render. Confirm the target video before calling. Ngram states that cancellation does not refund work already completed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `video_id` | string | Yes | ID of the in-progress Ngram video to cancel, beginning with vid_. Cancellation is irreversible and may not refund work already completed. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Webhook Subscription

**Slug:** `NGRAM_CREATE_WEBHOOK_SUBSCRIPTION`

Subscribe a public HTTPS endpoint to all account-wide Ngram video completion or failure events of one type. The response includes a signing secret that is shown only at creation and must be retained to verify webhook signatures.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `event_type` | string ("video.completed" | "video.failed") | Yes | Account-wide Ngram video event to deliver. |
| `target_url` | string | Yes | Public HTTPS callback URL that will receive matching account-wide events. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Webhook Subscription

**Slug:** `NGRAM_DELETE_WEBHOOK_SUBSCRIPTION`

Delete an Ngram webhook subscription by ID. The operation is idempotent: a missing subscription returns deleted=false rather than an error.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `subscription_id` | string | Yes | Ngram webhook subscription ID beginning with sub_, returned by webhook subscription creation or listing. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Image

**Slug:** `NGRAM_GENERATE_IMAGE`

Spend Ngram credits to start one image generation job from a prompt, optionally using one to four public HTTPS reference images for transformation. Inspect NGRAM_GET_CREDITS and NGRAM_GET_RENDER_OPTIONS first, then deliberately set confirm_credit_spend=true and reuse the same idempotency_key for retries. Exact cost has not been live-verified.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `prompt` | string | Yes | Description of the image to generate or the changes to make to reference images, from 1 to 6000 characters. |
| `model_id` | string | No | Image model ID from NGRAM_GET_RENDER_OPTIONS. |
| `style_id` | string | No | Image style ID from NGRAM_GET_RENDER_OPTIONS. Supported only for text-only generation without reference_image_urls. |
| `template_id` | string | No | Image template ID from NGRAM_GET_RENDER_OPTIONS. Supported only for text-only generation without reference_image_urls. |
| `aspect_ratio` | string | No | Image aspect ratio from NGRAM_GET_RENDER_OPTIONS. |
| `idempotency_key` | string | Yes | Stable unique key for this intended image job. Reuse it when retrying the same request to reduce duplicate jobs or charges. |
| `confirm_credit_spend` | boolean | Yes | Must be true to explicitly confirm that this call may consume Ngram credits. It is validated locally and is never sent to Ngram. |
| `reference_image_urls` | array | No | One to four public HTTPS source-image URLs to transform. Omit this field to generate an image from text only. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Video

**Slug:** `NGRAM_GENERATE_VIDEO`

Spend Ngram credits to start one asynchronous video render from text or a public URL. Inspect NGRAM_GET_CREDITS and NGRAM_GET_RENDER_OPTIONS first, then deliberately set confirm_credit_spend=true and supply a stable idempotency_key. Exact per-render cost has not been live-verified.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `prompt` | string | No | Source text or instructions. Required and non-blank when source_type is text; optional creative direction when source_type is url. |
| `duration` | integer | No | Requested duration in seconds from NGRAM_GET_RENDER_OPTIONS. |
| `scenario` | string | No | Scenario name from NGRAM_GET_RENDER_OPTIONS. |
| `style_id` | string | No | Video style ID from NGRAM_GET_RENDER_OPTIONS. |
| `voice_id` | string | No | Voice ID from NGRAM_GET_RENDER_OPTIONS. |
| `image_urls` | array | No | Optional public HTTP(S) image URLs to use as visual source material. |
| `story_flow` | string | No | Optional narrative-flow guidance, up to 1024 characters. |
| `source_type` | string ("text" | "url") | Yes | Whether to create the video from supplied text or instructions, or from research of a public webpage URL. Choose text when supplying prompt, or url when supplying website_url. |
| `website_url` | string | No | Public HTTP(S) webpage, article, product, or documentation URL. Required when source_type is url and not allowed for text mode. |
| `aspect_ratio` | string | No | Supported video aspect ratio from NGRAM_GET_RENDER_OPTIONS. |
| `energy_level` | string | No | Optional energy or pacing direction for the generated video. |
| `video_format` | string | No | Video format from NGRAM_GET_RENDER_OPTIONS. |
| `deep_research` | boolean | No | Whether Ngram should perform deeper source research before rendering. Omit to use the provider default. |
| `animation_mode` | string | No | Animation mode from NGRAM_GET_RENDER_OPTIONS. |
| `idempotency_key` | string | Yes | Stable unique key for this intended render. Reuse it for retries of the same render to prevent duplicate jobs or credit charges. |
| `video_type_profile` | string | No | Video type profile name from NGRAM_GET_RENDER_OPTIONS. |
| `confirm_credit_spend` | boolean | Yes | Must be true to explicitly confirm that this call may consume Ngram credits. It is validated locally and is never sent to Ngram. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Account

**Slug:** `NGRAM_GET_ACCOUNT`

Return the authenticated Ngram account identity, including its id, email, and name.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Credits

**Slug:** `NGRAM_GET_CREDITS`

Return the connected account's plan and available, reserved, and effective credits. Use effective credits as the spendable balance before generation.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Image

**Slug:** `NGRAM_GET_IMAGE`

Return an image job's current status and generated output by its UUID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `image_id` | string | Yes | UUID of the Ngram image job returned by image generation or listing. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Render Options

**Slug:** `NGRAM_GET_RENDER_OPTIONS`

Return Ngram's live catalog of supported video and image capabilities, voices, styles, formats, durations, models, templates, and other generation options. Use this before generation instead of assuming catalog values.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Video

**Slug:** `NGRAM_GET_VIDEO`

Return a video's render status, progress, output URL, or failure information by video ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `video_id` | string | Yes | Ngram video ID beginning with vid_, returned by video creation or listing. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Brand Kits

**Slug:** `NGRAM_LIST_BRAND_KITS`

Return the brand kits available to the connected account for use in generation requests.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Images

**Slug:** `NGRAM_LIST_IMAGES`

Return up to 100 account image jobs matching an optional status and created-at upper bound. Ngram does not expose a continuation token.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum image jobs to return, from 1 to 100. |
| `before` | string | No | Only return image jobs before this ISO-8601 temporal boundary; inclusivity is not verified. |
| `status` | string ("processing" | "completed" | "failed") | No | Only return image jobs in this generation state. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Videos

**Slug:** `NGRAM_LIST_VIDEOS`

Return up to 100 account videos matching an optional render status and created-at lower bound. This is one bounded response; Ngram provides no continuation token.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum videos to return, from 1 to 100. |
| `since` | string | No | Only return videos at or after this ISO 8601 temporal boundary. The provider's exact boundary inclusivity is not documented. |
| `status` | string ("processing" | "completed" | "failed") | No | Only return videos in this render state. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Webhook Subscriptions

**Slug:** `NGRAM_LIST_WEBHOOK_SUBSCRIPTIONS`

Return the account's video completion and failure webhook subscriptions. Signing secrets are not returned by this list endpoint.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
