Skip to main content

Context API Actions

Actions are the named enrichment operations the Context API can perform. Each action is specified by name in the actions object of a POST /content/process request.

All requests must include "version": "context.api/v2".

Every text and image action accepts an optional model field that chooses the AI model running that action. Model selection is in beta. Embedding actions do not accept model. Models other than the default can return different results, and those results are not always correct. Therefore, it is important to test a model on your own content before you rely on it. See Model Selection (Beta) for the available models, the default behavior, and the related errors.


Available Actions​

Action keyInput typeDescription
imageClassificationImageClassifies an image into one of the provided categories.
imageDescriptionImageGenerates a natural language description of an image.
imageEmbeddingsImageGenerates a vector embedding for an image.
imageMetadataGenerationImageGenerates structured metadata from an image.
namedEntityRecognitionImageImageDetects named entities in an image.
namedEntityRecognitionTextTextExtracts named entities from text.
textClassificationTextClassifies a text document into one of the provided categories.
textEmbeddingsTextGenerates a vector embedding for a text document.
textMetadataGenerationTextGenerates structured metadata from text.
textSummarizationTextGenerates a summary of a text document.

imageClassification​

Classifies the input image into one of the provided categories.

Requirements: Input must be an image file.

Constraints:

PropertyValue
Multilingual SupportYes
Max Input Image Size5 MB
Supported Image FormatsJPEG, PNG
Maximum Total Pixels per Image8000 × 8000
Image ScalingImages are scaled down preserving aspect ratio to meet size limits.
Recommended Max Pixels (Larger Side)Less than 1568 pixels
Minimum Edge SizeImages under 200 pixels on any edge may degrade performance.

Parameters:

FieldTypeRequiredDescription
classesstring[]YesAt least two distinct, non-empty classification categories
modelstringNoAI model that runs this action. Must be one of the 5 vision-capable models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNoJSON object providing additional context or guidance to the AI model

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../photo.png" }],
"actions": {
"imageClassification": {
"classes": ["City", "Nature", "Indoor", "Portrait"]
}
}
}

Result field: imageClassification.result — string with the matched class label


imageDescription​

Analyzes an image and generates a natural language description of its contents.

Requirements: Input must be an image file.

Constraints:

PropertyValue
Multilingual SupportYes
Accepted Image FormatsJPEG, PNG
Max Input Image Size5 MB
Max Image Dimensions8000 × 8000 pixels (scaled down preserving aspect ratio if exceeded)
Recommended DimensionsLess than 1568 pixels on the longer side
Minimum Effective SizeAvoid images with any edge < 200 pixels (may degrade performance)

Parameters:

FieldTypeRequiredDefaultDescription
maxWordCountintegerNo200Maximum number of words in the description. Must be > 0.
modelstringNo—AI model that runs this action. Must be one of the 5 vision-capable models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNo—JSON object providing additional context or guidance to the AI model.

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../photo.png" }],
"actions": {
"imageDescription": {
"maxWordCount": 100
}
}
}

Result field: imageDescription.result — string with the generated description


imageEmbeddings​

Converts an image into a high-dimensional vector representation. Use for visual similarity search and clustering.

Requirements: Input must be an image file.

Constraints:

PropertyValue
Languages SupportedEnglish
Max Input Image Size15 MB
Supported Image FormatsPNG, JPEG
Output Vector Size1,024

Parameters: None.

note

Image embeddings use path-based input only. The documentId input format is not supported for this action.

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../photo.jpg" }],
"actions": {
"imageEmbeddings": {}
}
}

Result field: imageEmbeddings.result — flat float[] array (v2). See Embeddings for format details.


imageMetadataGeneration​

Generates structured metadata from an image, optionally guided by example metadata templates.

Requirements: Input must be an image file.

Constraints:

PropertyValue
Multilingual SupportYes
Max Input Image Size5 MB
Supported Image FormatsJPEG, PNG
Max Total Pixels per Image8000 px × 8000 px
Image ScalingImages are scaled down (preserving aspect ratio) to fit within size limits
Recommended Image SizeLess than 1568 pixels on the larger side
Minimum Image Size WarningImages under 200 pixels on any edge may degrade performance

Parameters:

FieldTypeRequiredDescription
kSimilarMetadataobject[]YesAt least one example metadata object to guide generation. Each item is a free-form JSON object with representative keys and values.
modelstringNoAI model that runs this action. Must be one of the 5 vision-capable models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNoJSON object providing additional context or guidance to the AI model.

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../photo.png" }],
"actions": {
"imageMetadataGeneration": {
"kSimilarMetadata": [
{
"location": "New York City",
"keywords": "urban|city|skyline",
"summary": "Urban street photography"
}
]
}
}
}

Result field: imageMetadata.result — JSON object with generated metadata fields.


namedEntityRecognitionImage​

Detects named entities (people, organizations, locations) in an image.

Requirements: Input must be an image file.

Constraints:

PropertyValue
Multilingual SupportYes
Max Input Image Size5 MB
Supported Image FormatsJPEG, PNG
Maximum Total Pixels per Image8000 × 8000
Image ScalingImages are scaled down preserving aspect ratio to meet size limits.
Recommended Max Pixels (Larger Side)Less than 1568 pixels
Minimum Edge SizeImages under 200 pixels on any edge may degrade performance.

Parameters:

FieldTypeRequiredDescription
modelstringNoAI model that runs this action. Must be one of the 5 vision-capable models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNoJSON object providing additional context or guidance to the AI model

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../photo.png" }],
"actions": {
"namedEntityRecognitionImage": {}
}
}

Result field: namedEntityImage.result — dictionary mapping entity type names to arrays of detected values (for example, { "organizations": ["Hyland"], "locations": ["Times Square"] })


namedEntityRecognitionText​

Extracts named entities from document text.

Requirements: Input must be a text-based document.

Constraints:

PropertyValue
Maximum input character800K

Parameters:

FieldTypeRequiredDescription
modelstringNoAI model that runs this action. Must be one of the 9 models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNoJSON object providing additional context or guidance to the AI model.

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../document.pdf" }],
"actions": {
"namedEntityRecognitionText": {
"instructions": {
"focus": "Extract company names and contract dates"
}
}
}
}

Result field: namedEntityText.result — dictionary mapping entity type names to arrays of detected values (for example, { "organizations": ["Hyland"], "dates_times": ["2025-01-01"] })


textClassification​

Classifies a text document into one of the provided categories.

Requirements: Input must be a text-based document.

Constraints:

PropertyValue
Maximum input character800K

Parameters:

FieldTypeRequiredDescription
classesstring[]YesAt least two distinct, non-empty classification categories
modelstringNoAI model that runs this action. Must be one of the 9 models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNoJSON object providing additional context or guidance to the AI model

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../document.pdf" }],
"actions": {
"textClassification": {
"classes": ["Report", "Contract", "Invoice", "Other"]
}
}
}

Result field: textClassification.result — string with the matched class label


textEmbeddings​

Generates a vector embedding for a text document.

Requirements: Input must be a text-based document.

Parameters: None

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../document.pdf" }],
"actions": {
"textEmbeddings": {}
}
}

Result field: textEmbeddings.result — flat float[] array (v2). See Embeddings for format details.


textMetadataGeneration​

Generates structured metadata from a text document, optionally guided by example metadata templates.

Requirements: Input must be a text-based document.

Constraints:

PropertyValue
Maximum input character800K

Parameters:

FieldTypeRequiredDescription
kSimilarMetadataobject[]YesAt least one example metadata object to guide generation
modelstringNoAI model that runs this action. Must be one of the 9 models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNoJSON object providing additional context or guidance to the AI model

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../report.pdf" }],
"actions": {
"textMetadataGeneration": {
"kSimilarMetadata": [
{
"document_type": "Financial Report",
"author": "John Smith",
"date": "2025-01"
}
]
}
}
}

Result field: textMetadata.result — JSON object with generated metadata fields


textSummarization​

Generates a summary of a text document.

Requirements: Input must be a text-based document.

Constraints:

PropertyValue
Maximum input character800K

Parameters:

FieldTypeRequiredDefaultDescription
maxWordCountintegerNo200Maximum word count of the summary. Must be > 0.
modelstringNo—AI model that runs this action. Must be one of the 9 models listed in Model Selection (Beta). When omitted, the action runs on its default model.
instructionsobjectNo—JSON object providing additional context or guidance to the AI model.

Request example:

{
"version": "context.api/v2",
"objectKeys": [{ "path": "testing/.../report.pdf" }],
"actions": {
"textSummarization": {
"maxWordCount": 150,
"instructions": {
"focus": "Key financial metrics and risks",
"style": "professional"
}
}
}
}

Result field: textSummary.result — string with the generated summary