> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

An AI Action is an entity that can be used to specify a configurable instruction that is later processed by a Language Learning Model (LLM).
AI Actions are space-scoped, whereas invoking an AI Action takes place in the context of an entire environment.

#### AI Action configuration

#### Variables

Variables are configuration parameters for AI Actions that accept dynamic input when the action is executed. Each AI Action can define multiple variables of different types.

| Variable Type    | Description                                                                                                                                                                                                                                                                  |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Text`           | Accepts plain text input from the user. Can be configured with predefined options using the `in: ['option1', 'option2', ...]` parameter to create dropdown selection behaviour, with `strict: true` a validation runs for the variable, enforcing one of the defined values. |
| `Locale`         | Enables selection of a locale configured in the current space. Must include a `configuration.localeType` of either `Target` (AI output will be written to this locale) or `Source` (informs AI which locale the field is using)                                              |
| `MediaReference` | Allows selection of media assets such as images or documents                                                                                                                                                                                                                 |
| `Reference`      | Enables linking to an existing entry. When invoked, the value must be a `sys` Link object containing `type`, `linkType`, `id`, and optionally `entityPaths` (an array of JSON pointer paths such as `/fields/title` to target specific fields on the entry)                  |
| `StandardInput`  | Default system input mechanism                                                                                                                                                                                                                                               |

#### Model configuration

AI Actions can be configured with different language models and parameters that affect the model's behavior.

#### Available models

| Provider             | Description                                                                   |
| -------------------- | ----------------------------------------------------------------------------- |
| **Anthropic Claude** | Premium AI models optimized for natural language understanding and generation |
| **OpenAI GPT**       | Advanced GPT models for versatile text processing and generation              |
| **Custom Models**    | Support for integrating third-party models via custom endpoints               |

#### Temperature Configuration

The temperature parameter controls the randomness and creativity of AI-generated outputs:

| Setting    | Value        | Recommended Use Cases                                                                 |
| ---------- | ------------ | ------------------------------------------------------------------------------------- |
| **Low**    | 0.1          | Content requiring precision: translations, factual summaries, technical documentation |
| **High**   | 0.7          | Creative content: storytelling, marketing copy, idea generation                       |
| **Custom** | User-defined | Specialized use cases requiring fine-tuned output characteristics                     |

When creating or updating an AI Action, these configuration options can be specified in the request body.

## AI Actions collection

[Get all AI actions](/references/content-management-api/ai-actions/get-all-ai-actions)

Returns all the AI Actions that exist in a given space.

[Create an AI action](/references/content-management-api/ai-actions/create-an-ai-action)

Use this endpoint to create a new AI Action for a specified space.

## Query AI Actions

To query AI Actions, use the [Get all AI actions](/references/content-management-api/ai-actions/get-all-ai-actions) endpoint. This endpoint allows to query AI Actions with certain filters. The filters are defined as query parameters which are described in the endpoint specifications.

## AI Action

[Get an AI action](/references/content-management-api/ai-actions/get-an-ai-action)

Use this endpoint to read an AI Action for a specified space.

[Update AI Action](/references/content-management-api/ai-actions/update-ai-action)

Use this endpoint to update an AI Action for a specified space.

[Delete AI Action](/references/content-management-api/ai-actions/delete-ai-action)

Use this endpoint to delete an AI Action for a specified space.

## Publish AI Action

[Publish an AI action](/references/content-management-api/ai-actions/publish-an-ai-action)

Use this endpoint to publish an AI Action for a specified space.

[Unpublish an AI action](/references/content-management-api/ai-actions/unpublish-an-ai-action)

Use this endpoint to unpublish an AI Action for a specified space.

## Invoke AI Action

[Invoke an AI action](/references/content-management-api/ai-actions/invoke-an-ai-action)

Use this endpoint to invoke an AI Action for a specified space and environment.

## Reading result of AI Action Invocation

[Get an AI action invocation](/references/content-management-api/ai-actions/get-an-ai-action-invocation)

Use this endpoint to obtain the result of an AI Action Invocation for a specified space, environment, AI Action and Invocation.