# AIQuickActionCustomActionDefinition

typedef

A custom AI quick action definition.

The action needs a prompt source, provided in one of three ways:

* an inline `prompt` string - sent as the prompt,
* a `context` reference - the referenced context drives the action (for example through a prompt it contains),
* both - the inline `prompt` is used and the `context` is attached as additional reference material (for example a file).

The `model` property is optional. If not specified, the default model (from the `ai.models.defaultModelId` configuration or the first available model) is used.

```typescript
{
	id: 'add-quote-from-famous-person',
	label: 'Add a quote from a famous person',
	prompt: 'Add a quote from a known person, which would make sense in the context of the selected text.',
	type: 'action',
	model: 'claude-4-6-sonnet'
}
```

The same action using a `context` reference instead of an inline `prompt`:

```typescript
{
	id: 'add-quote-from-famous-person',
	label: 'Add a quote from a famous person',
	context: { id: 'my-context', promptId: 'add-quote' },
	type: 'action',
	model: 'claude-4-6-sonnet'
}
```

An inline `prompt` combined with a `context` that attaches a single file as reference material:

```typescript
{
	id: 'add-quote-from-famous-person',
	label: 'Add a quote from a famous person',
	prompt: 'Add a quote from a known person, which would make sense in the context of the selected text.',
	context: { id: 'my-context', fileId: 'famous-quotes' },
	type: 'action',
	model: 'claude-4-6-sonnet'
}
```

<a id="properties">

## Properties

<a id="member-context">

### `context?: AIContextRef` _(readonly)_

A context reference attached to the action.

When no inline `prompt` is provided, the referenced context drives the action (a whole context or a `promptId` reference). When combined with an inline `prompt`, it is attached as additional reference material (for example a single file).

**Experimental:** This is a production-ready API but may change in minor releases without the standard deprecation policy. Check the changelog for migration guidance.

<a id="member-prompt">

### `prompt?: string` _(readonly)_

The prompt to be sent to the AI model when the action is executed.

At least one prompt source is required: an inline `prompt`, a `context` that carries a prompt (a whole context or a `promptId` reference), or both. A `context` that references only a single file (`fileId`) cannot drive the action on its own and must be combined with an inline `prompt`.

<a id="member-type">

### `type: 'action'`

#### Value

`AIQuickActionCustomBaseDefinition & object`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
