Sanity Agent Actions
AI model · Translation · Text → Text by Sanity
AI building blocks for structured content workflows
Sanity Agent Actions provides schema-aware AI building blocks for developers to automate content generation, translation, and transformation. It ensures all AI-generated outputs strictly follow your defined content models, making it ideal for high-scale, automated content operations.
Model specs
The full spec card (context, pricing per token, modalities and more) on AntSpace. Sign up free to see the full spec card.
Category: Generative AI
- Access
- API, scripts, CI pipelines, and Sanity Studio integration
- Released
- 2026-01-20 (Community Event: Content Agent Q&A)
- Integration Method
- Agent API, scripts, CI pipelines
- Validation Type
- Schema-aware automatic validation
- Execution Modes
- Synchronous or background processing
- Data Format
- Structured JSON (Content Lake)
- Schema-aware AI for content generation, translation, and transformation
- Automatic validation against Sanity Studio content types
- Triggerable via API, scripts, CI pipelines, or dataset mutations
- Supports background processing for large-scale dataset updates
Overview
Sanity Agent Actions is a suite of event-driven, schema-aware APIs designed for businesses to automate complex content operations using large language models. It enables developers to generate, transform, and translate content while ensuring every output is automatically validated against the specific content types defined in their Sanity Studio schema. The system can be triggered programmatically via the Agent API or through dataset mutations, allowing for high-scale updates across entire datasets without manual intervention. By integrating with the Sanity Content Lake, it allows teams to automate tasks like metadata tagging, regional localization, and content enrichment directly within their existing publishing pipelines. This programmable approach to AI ensures that structural integrity, such as references and slugs, remains intact during automated workflows.
Translation and Localization
- Schema-Aware Translation: The model translates entire documents or specific fields between languages while respecting the underlying schema and preserving intent.
- Style Guide Enforcement: Users can provide a style guide to preserve specific tones, such as formal tone and legal terminology, without paraphrasing.
- Structural Integrity: The translation process preserves critical structured data elements including references, slugs, and schema integrity.
- Terminology Control: Glossaries and do-not-translate rules can be stored as structured content and fed to the API at translation time.
Content Automation
- Dynamic Content Generation: The model generates schema-valid content using dynamic prompts that combine template text with live values from GROQ or document fields.
- Content Transformation: Developers can reshape content structure, style, or tone automatically to adapt messaging or standardize imported data.
- Automatic Schema Validation: Outputs are automatically validated against the content types in the Sanity Studio schema to ensure they always fit the defined structure.
- Flexible Execution Modes: Operations can be run synchronously for immediate results or in the background for larger tasks.
Developer Integration
- Code-First Automation: The Agent API allows triggering content updates directly from code, scripts, or CI pipelines without a user interface.
- Dataset-Scale Operations: Agent Actions scale to handle updates across entire datasets, from single fields to thousands of items.
Use cases
- Developers automate field-level translations across thousands of documents while preserving schema integrity and references.
- Content teams generate SEO metadata and alt text for images automatically based on existing document values and GROQ queries.
- Organizations standardize imported data by reshaping content structure, style, or tone to match brand guidelines at scale.
- E-commerce brands trigger automated product description updates across multiple regions whenever a base product is modified in the ERP.
Specifications
- Access
- API, scripts, CI pipelines, and Sanity Studio integration
- Fine-tuning
- Customizable via structured prompts, style guides, glossaries, and do-not-translate rules
- Released
- 2026-01-20 (Community Event: Content Agent Q&A)
- Languages
- Supports multiple human languages including English (en-GB) and Norwegian Bokmål (no-NB)
- Integration Method
- Agent API, scripts, CI pipelines
- Validation Type
- Schema-aware automatic validation
- Trigger Types
- Content updates, editorial input, external events, Sanity Functions
- Execution Modes
- Synchronous or background processing
- Data Format
- Structured JSON (Content Lake)
- Query Support
- GROQ, GraphQL
How it works
- Define Schema and Operation: Developers define the target document operation (e.g., create or transform) and the specific schema ID to be used.
- Configure Instructions: Users provide instructions and parameters, which can include live values from GROQ queries or constant values.
- Execute via Agent API: The Agent API processes the request using large language models, validating the output against the defined schema.
- Update Content Lake: The resulting schema-valid content is integrated into the Content Lake, either synchronously or as a background task.
Pricing
- Free Plan (Included AI Credits)
- 1,000 credits per month
- Growth Plan (Included AI Credits)
- 1,000 credits per month
- Enterprise Plan (Included AI Credits)
- 5,000 credits per month
- Additional AI Credits (Growth Plan)
- $0.05 per AI credit
- Additional Agent Action Requests
- $0.05 per action
FAQ
What are Sanity Agent Actions?
Agent Actions are event-driven, schema-aware APIs that automate content operations like enrichment and translation, triggered by dataset changes.
How does it ensure data integrity?
Unlike generic AI, Agent Actions automatically validate outputs against your specific Sanity Studio schema, ensuring responses always fit your content types.
Can I use Agent Actions without the Sanity Studio?
Yes, Agent Actions can be triggered using APIs, scripts, or CI pipelines without needing the Studio UI, though hooks can be integrated into the Studio.
How can I control the terminology used in translations?
You can store glossaries, style guides, and do-not-translate rules as structured content and feed them to the Agent API at translation time.
Added by AntSpace from public sources (sanity.io).