Request body
A list of conversational turns, alternating between the user and the assistant,
or a single instruction string.Please note that there are two different options for the input.
show possible types
show possible types
Text input
A plain instruction string for AI21 Maestro. Equivalent to a single message with the user role.
Input messages
A list of message objects representing a multi-turn conversation alternating between the user and the assistant.
string
A plain instruction string for AI21 Maestro. Equivalent to a single message with the user role.
Input messages
object []
A list of message objects representing a multi-turn conversation alternating between the user and the assistant.
Explicit requirements for the output. The requirements can be in terms of content, style, format, genre, point of view, and various guardrails AI21 Maestro will allocate resources to maintain all requirements throughout the run. At the end of the run, the score for each requirement and the overall score will be returned. Users can specify up to 10 requirements.
Examples of requirements:
Show properties
Show properties
The requirement’s name, which allows users to reference it in their applications later.
The requirement’s description in natural language. This will influence our result scoring and budget allocation. The maximum length for each description is 128 words.
Default: false.
If set to
If set to
true
, and the associated requirement is not fully satisfied, the overall requirements_result score will be 0.- “Write up to 3 paragraphs”
- “Output only the answer”
- “Don’t mention a word about the company’s CEO”
- “Use a friendly tone”
Avoid conflicting requirementsConflicts may reduce run quality or prevent fulfillment.
An array of objects. Each object describes a tool that AI21 Maestro may invoke during execution. The behavior and required fields vary depending on the tool’s
type
.Show possible types
Show possible types
MCP Tool
Use this tool type to allow AI21 Maestro to interact with external services through the Model Context Protocol (MCP). MCP enables dynamic discovery of available tools and resources provided by an MCP server, making integration more flexible and extensible.
HTTP Tool
Use this tool type to allow AI21 Maestro to perform HTTP POST requests to an external service.
JSON ExampleFile_Search Tool
When provided, this object defines filters that AI21 Maestro will apply whenever it performs a file search.
Web_Search Tool
When provided, this object defines filters that AI21 Maestro will apply whenever it performs a web search.
object
Use this tool type to allow AI21 Maestro to interact with external services through the Model Context Protocol (MCP). MCP enables dynamic discovery of available tools and resources provided by an MCP server, making integration more flexible and extensible.
Show fields
Show fields
The string has to be
mcp
.Unique name for the MCP server within the session.
Fully qualified URL of the MCP server endpoint.
Authentication headers (e.g., bearer tokens).
List of tool names that Maestro can use. Must align with the tools exposed by the MCP server.
If not specified, all tools will be loaded.
If not specified, all tools will be loaded.
object
Use this tool type to allow AI21 Maestro to perform HTTP POST requests to an external service.
Show fields
Show fields
The string has to be
http
.Describes the callable function interface of the tool.
Show function fields
Show function fields
A unique identifier for the tool. Should clearly reflect the action it performs.
An explanation of what the tool does and when it should be used.
A JSON Schema describing the input parameters this tool accepts.
Each parameter should preferably include a description.
Each parameter should preferably include a description.
Only
For more information on how the request is made, see the following example.
POST
requests are currently supported. For more information on how the request is made, see the following example.
object
When provided, this object defines filters that AI21 Maestro will apply whenever it performs a file search.
Show fields
Show fields
object
When provided, this object defines filters that AI21 Maestro will apply whenever it performs a web search.
Show fields
Show fields
The string has to be
web_search
.Restrict web search to the specified URL prefixes. The following formats are valid:
https://example.com
– limits to URLs that start withwww.example.com
example.com
– limits to URLs that start withwww.example.com
example.com/page
– limits to URLs that start withwww.example.com/page
sub.example.com
– limits to URLs that start with the specified subdomain (e.g.,docs.example.com
,blog.example.com
)
If not provided, search is not restricted to specific domains.
A set of resources used by AI21 Maestro’s tools.
The
Use the
tool_resources
parameter will be deprecated in October 2025 .Use the
tools
parameter instead.Validation has been added to restrict the number of search tools you can provide.
If more than one
the request will fail with 422 Unprocessable Entity.
Error message:
You are only allowed to provide one instance of
If more than one
web_search
or file_search
tool is included,the request will fail with 422 Unprocessable Entity.
Error message:
You are only allowed to provide one instance of
file_search
or web_search
tools.Show properties
Show properties
When provided, this object defines filters that AI21 Maestro will apply whenever it performs a file search.
When provided, this object defines filters that AI21 Maestro will apply whenever it performs a web search.
Show properties
Show properties
Restrict web search to the specified URL prefixes. The following formats are valid:
https://example.com
– limits to URLs that start withwww.example.com
example.com
– limits to URLs that start withwww.example.com
example.com/page
– limits to URLs that start withwww.example.com/page
sub.example.com
– limits to URLs that start with the specified subdomain (e.g.,docs.example.com
,blog.example.com
)
defaults to null.Specify a single model to be used for the run. Choose from the following:First-Party Models Models hosted and managed by AI21:
Bring‑Your‑Own‑Key (BYOK) third‑party models:
Specify the ID of a third-party model configured on the 3rd-Party Models page.These models require your own API key. AI21 uses your key to authenticate and access the model on your behalf. Supported providers include OpenAI, Anthropic, and Google.
jamba-large
jamba-mini
gpt-4o
– The latest GPT‑4o model, accessed using AI21’s own API keymistral-8x7b
mistral-7b
mistral-small
Bring‑Your‑Own‑Key (BYOK) third‑party models:
Specify the ID of a third-party model configured on the 3rd-Party Models page.These models require your own API key. AI21 uses your key to authenticate and access the model on your behalf. Supported providers include OpenAI, Anthropic, and Google.
Controls how many resources AI21 Maestro allocates to fulfill a task, including the number of execution steps and the level of effort applied.The higher the budget, the more likely latency and execution costs will increase.
Accepted values:
Accepted values:
low
- One execution step is taken with minimal effort to fulfill the requirements.medium
- Multiple execution steps are taken with moderate effort to fulfill the requirements.high
- Multiple execution strategies, each containing multiple execution steps, are used with maximum effort to fulfill the requirements.
low
if not provided.Specify which extra fields should be included in the output. If not provided, none of these fields will be included. Supported values:
data_sources
— Includes thedata_sources
field in the output.requirements_result
— Includes detailed results for each requirement in therequirements_result
field.
Controls the output language of AI21 Maestro responses.
Response language can be only one of the following: “arabic”, “dutch”, “english”, “french”, “german”, “hebrew”, “italian”, “portuguese”, “spanish”.
If not provided, defaults to English.
Response language can be only one of the following: “arabic”, “dutch”, “english”, “french”, “german”, “hebrew”, “italian”, “portuguese”, “spanish”.
If not provided, defaults to English.