AI agents
The agent that says by which rules an account’s AI work runs — which instruction, which model, how hard to try and how long to wait. Every change is a new version, and the settings of each version stay readable.
List AI agents
The reusable settings of an AI run in an account: which instruction it follows, which model it runs on, how hard it tries and how long it waits. Every change is a new version, and the settings of each version are kept, so what any run used can be looked up later.
path Parameters
account_idId of the parent account.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: create_time, display_name.
filterAIP-160 subset (§8). Filterable: allowed_model_ids, create_time, display_name, instruction_id, is_enabled, preferred_model_id, version. A field outside the list is INVALID_ARGUMENT.
List AI agents › Responses
One page of ai_agents.
This page of ai_agents, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create AI agent
Creates an agent at version 1. Name an instruction of the account with instruction_id, or set source_system_agent to copy a platform agent — its settings, and its instruction text as a new instruction of the account — with any other fields of the body applied over the copy.
Settings that could never run are refused here rather than at the first run: a model that is not AVAILABLE, an effort on a model without the EFFORT capability, a JSON agent on a model without STRUCTURED_OUTPUT, a max_tokens above the model's limit.
path Parameters
account_idId of the parent account.
Create AI agent › Request Body
display_nameThe label that tells this agent apart in a list. Required on create unless source_system_agent supplies it.
descriptionWhat the agent is for, for the people who maintain it.
instruction_idThe id of the account's ai_instructions entry this agent runs. Required on create unless source_system_agent is set, which creates the instruction too.
instruction_versionPin the agent to one version of its instruction. Absent means the instruction's active_version at the moment a run starts.
preferred_model_idThe ai_models entry a run uses when it does not name a model. Must be AVAILABLE when set, and able to run what this agent asks of it.
allowed_model_idsThe only models a run of this agent may name. Empty means any available model; when not empty, it must include preferred_model_id.
max_tokensThe most tokens one run may write, at most the model's max_output_tokens. Defaults to 16000.
effortHow hard the model is asked to think: LOW, MEDIUM, HIGH, XHIGH or MAX. Leave it unset for the model's default — and on a model without the EFFORT capability, which refuses any level.
output_formatTEXT (the default); JSON — an answer that follows output_schema, on a model with STRUCTURED_OUTPUT; or IMAGE — a picture, on a model with IMAGE_GENERATION, whose rendered instruction is the prompt and whose result is an artifact of the run rather than text.
output_schemaThe JSON Schema object a JSON agent's answer must follow. Required when output_format is JSON and refused otherwise.
image_widthThe width of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_heightThe height of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_qualityHow much care an IMAGE agent's picture is drawn with: LOW, MEDIUM, HIGH, XHIGH or MAX. Interpreted by the model's provider: on openai it is the picture's quality, and a higher one produces more output tokens; bfl has no such setting and ignores it. Leave it unset for the provider's default. Refused on a TEXT or JSON agent.
connection_modeWhich of the account's connections a run may be authorized through: ANY (the default), BYOK_ONLY or MANAGED_ONLY.
max_attemptsHow many times a run is tried when the provider fails in a way worth retrying: 1 to 10, default 3.
timeoutHow long one call to the provider may take: a number of seconds with the s suffix, 1s to 600s. Defaults to 120s.
allowed_toolsTools the model may call. Must be empty: an agent calls no tools.
is_enabledWhether the agent may run. Switch it off to stop new runs without deleting it.
source_system_agentCreate only: the id of an ai_system_agents entry to copy. Its settings and its instruction text — as a new instruction of this account — become the new agent's, under any fields the body also sets.
Create AI agent › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe label that tells this agent apart in a list. Required on create unless source_system_agent supplies it.
descriptionWhat the agent is for, for the people who maintain it.
instruction_idThe id of the account's ai_instructions entry this agent runs. Required on create unless source_system_agent is set, which creates the instruction too.
instruction_versionPin the agent to one version of its instruction. Absent means the instruction's active_version at the moment a run starts.
preferred_model_idThe ai_models entry a run uses when it does not name a model. Must be AVAILABLE when set, and able to run what this agent asks of it.
allowed_model_idsThe only models a run of this agent may name. Empty means any available model; when not empty, it must include preferred_model_id.
max_tokensThe most tokens one run may write, at most the model's max_output_tokens. Defaults to 16000.
effortHow hard the model is asked to think: LOW, MEDIUM, HIGH, XHIGH or MAX. Leave it unset for the model's default — and on a model without the EFFORT capability, which refuses any level.
output_formatTEXT (the default); JSON — an answer that follows output_schema, on a model with STRUCTURED_OUTPUT; or IMAGE — a picture, on a model with IMAGE_GENERATION, whose rendered instruction is the prompt and whose result is an artifact of the run rather than text.
output_schemaThe JSON Schema object a JSON agent's answer must follow. Required when output_format is JSON and refused otherwise.
image_widthThe width of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_heightThe height of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_qualityHow much care an IMAGE agent's picture is drawn with: LOW, MEDIUM, HIGH, XHIGH or MAX. Interpreted by the model's provider: on openai it is the picture's quality, and a higher one produces more output tokens; bfl has no such setting and ignores it. Leave it unset for the provider's default. Refused on a TEXT or JSON agent.
connection_modeWhich of the account's connections a run may be authorized through: ANY (the default), BYOK_ONLY or MANAGED_ONLY.
max_attemptsHow many times a run is tried when the provider fails in a way worth retrying: 1 to 10, default 3.
timeoutHow long one call to the provider may take: a number of seconds with the s suffix, 1s to 600s. Defaults to 120s.
allowed_toolsTools the model may call. Must be empty: an agent calls no tools.
is_enabledWhether the agent may run. Switch it off to stop new runs without deleting it.
versionThe configuration's version: 1 on create, and one more on every update. Each version's settings are kept under versions.
Get AI agent
The reusable settings of an AI run in an account: which instruction it follows, which model it runs on, how hard it tries and how long it waits. Every change is a new version, and the settings of each version are kept, so what any run used can be looked up later.
path Parameters
account_idId of the parent account.
ai_agent_idId of the parent ai_agent.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get AI agent › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe label that tells this agent apart in a list. Required on create unless source_system_agent supplies it.
descriptionWhat the agent is for, for the people who maintain it.
instruction_idThe id of the account's ai_instructions entry this agent runs. Required on create unless source_system_agent is set, which creates the instruction too.
instruction_versionPin the agent to one version of its instruction. Absent means the instruction's active_version at the moment a run starts.
preferred_model_idThe ai_models entry a run uses when it does not name a model. Must be AVAILABLE when set, and able to run what this agent asks of it.
allowed_model_idsThe only models a run of this agent may name. Empty means any available model; when not empty, it must include preferred_model_id.
max_tokensThe most tokens one run may write, at most the model's max_output_tokens. Defaults to 16000.
effortHow hard the model is asked to think: LOW, MEDIUM, HIGH, XHIGH or MAX. Leave it unset for the model's default — and on a model without the EFFORT capability, which refuses any level.
output_formatTEXT (the default); JSON — an answer that follows output_schema, on a model with STRUCTURED_OUTPUT; or IMAGE — a picture, on a model with IMAGE_GENERATION, whose rendered instruction is the prompt and whose result is an artifact of the run rather than text.
output_schemaThe JSON Schema object a JSON agent's answer must follow. Required when output_format is JSON and refused otherwise.
image_widthThe width of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_heightThe height of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_qualityHow much care an IMAGE agent's picture is drawn with: LOW, MEDIUM, HIGH, XHIGH or MAX. Interpreted by the model's provider: on openai it is the picture's quality, and a higher one produces more output tokens; bfl has no such setting and ignores it. Leave it unset for the provider's default. Refused on a TEXT or JSON agent.
connection_modeWhich of the account's connections a run may be authorized through: ANY (the default), BYOK_ONLY or MANAGED_ONLY.
max_attemptsHow many times a run is tried when the provider fails in a way worth retrying: 1 to 10, default 3.
timeoutHow long one call to the provider may take: a number of seconds with the s suffix, 1s to 600s. Defaults to 120s.
allowed_toolsTools the model may call. Must be empty: an agent calls no tools.
is_enabledWhether the agent may run. Switch it off to stop new runs without deleting it.
versionThe configuration's version: 1 on create, and one more on every update. Each version's settings are kept under versions.
Delete AI agent
Deletes an agent. Its instruction is not deleted, and the settings of its versions are kept for the runs that used them, though they are no longer listed.
path Parameters
account_idId of the parent account.
ai_agent_idId of the parent ai_agent.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete AI agent › Responses
Deleted. No body (§7).
Update AI agent
Changes an agent's settings. Every update raises version by exactly one — even one that changes nothing — and keeps the settings of the version it replaces under versions. Send the etag in If-Match to be refused with ABORTED if someone else changed the agent first.
path Parameters
account_idId of the parent account.
ai_agent_idId of the parent ai_agent.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update AI agent › Request Body
display_nameThe label that tells this agent apart in a list. Required on create unless source_system_agent supplies it.
descriptionWhat the agent is for, for the people who maintain it.
instruction_idThe id of the account's ai_instructions entry this agent runs. Required on create unless source_system_agent is set, which creates the instruction too.
instruction_versionPin the agent to one version of its instruction. Absent means the instruction's active_version at the moment a run starts.
preferred_model_idThe ai_models entry a run uses when it does not name a model. Must be AVAILABLE when set, and able to run what this agent asks of it.
allowed_model_idsThe only models a run of this agent may name. Empty means any available model; when not empty, it must include preferred_model_id.
max_tokensThe most tokens one run may write, at most the model's max_output_tokens. Defaults to 16000.
effortHow hard the model is asked to think: LOW, MEDIUM, HIGH, XHIGH or MAX. Leave it unset for the model's default — and on a model without the EFFORT capability, which refuses any level.
output_formatTEXT (the default); JSON — an answer that follows output_schema, on a model with STRUCTURED_OUTPUT; or IMAGE — a picture, on a model with IMAGE_GENERATION, whose rendered instruction is the prompt and whose result is an artifact of the run rather than text.
output_schemaThe JSON Schema object a JSON agent's answer must follow. Required when output_format is JSON and refused otherwise.
image_widthThe width of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_heightThe height of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_qualityHow much care an IMAGE agent's picture is drawn with: LOW, MEDIUM, HIGH, XHIGH or MAX. Interpreted by the model's provider: on openai it is the picture's quality, and a higher one produces more output tokens; bfl has no such setting and ignores it. Leave it unset for the provider's default. Refused on a TEXT or JSON agent.
connection_modeWhich of the account's connections a run may be authorized through: ANY (the default), BYOK_ONLY or MANAGED_ONLY.
max_attemptsHow many times a run is tried when the provider fails in a way worth retrying: 1 to 10, default 3.
timeoutHow long one call to the provider may take: a number of seconds with the s suffix, 1s to 600s. Defaults to 120s.
allowed_toolsTools the model may call. Must be empty: an agent calls no tools.
is_enabledWhether the agent may run. Switch it off to stop new runs without deleting it.
source_system_agentCreate only: the id of an ai_system_agents entry to copy. Its settings and its instruction text — as a new instruction of this account — become the new agent's, under any fields the body also sets.
Update AI agent › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe label that tells this agent apart in a list. Required on create unless source_system_agent supplies it.
descriptionWhat the agent is for, for the people who maintain it.
instruction_idThe id of the account's ai_instructions entry this agent runs. Required on create unless source_system_agent is set, which creates the instruction too.
instruction_versionPin the agent to one version of its instruction. Absent means the instruction's active_version at the moment a run starts.
preferred_model_idThe ai_models entry a run uses when it does not name a model. Must be AVAILABLE when set, and able to run what this agent asks of it.
allowed_model_idsThe only models a run of this agent may name. Empty means any available model; when not empty, it must include preferred_model_id.
max_tokensThe most tokens one run may write, at most the model's max_output_tokens. Defaults to 16000.
effortHow hard the model is asked to think: LOW, MEDIUM, HIGH, XHIGH or MAX. Leave it unset for the model's default — and on a model without the EFFORT capability, which refuses any level.
output_formatTEXT (the default); JSON — an answer that follows output_schema, on a model with STRUCTURED_OUTPUT; or IMAGE — a picture, on a model with IMAGE_GENERATION, whose rendered instruction is the prompt and whose result is an artifact of the run rather than text.
output_schemaThe JSON Schema object a JSON agent's answer must follow. Required when output_format is JSON and refused otherwise.
image_widthThe width of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_heightThe height of the picture an IMAGE agent asks for, in pixels, 64 to 4096; defaults to 1024. Refused on a TEXT or JSON agent.
image_qualityHow much care an IMAGE agent's picture is drawn with: LOW, MEDIUM, HIGH, XHIGH or MAX. Interpreted by the model's provider: on openai it is the picture's quality, and a higher one produces more output tokens; bfl has no such setting and ignores it. Leave it unset for the provider's default. Refused on a TEXT or JSON agent.
connection_modeWhich of the account's connections a run may be authorized through: ANY (the default), BYOK_ONLY or MANAGED_ONLY.
max_attemptsHow many times a run is tried when the provider fails in a way worth retrying: 1 to 10, default 3.
timeoutHow long one call to the provider may take: a number of seconds with the s suffix, 1s to 600s. Defaults to 120s.
allowed_toolsTools the model may call. Must be empty: an agent calls no tools.
is_enabledWhether the agent may run. Switch it off to stop new runs without deleting it.
versionThe configuration's version: 1 on create, and one more on every update. Each version's settings are kept under versions.
List AI agent versions
The immutable settings of an agent at one version, written by the update that produced it. create_time is when that version took effect, so the settings in force at any moment are those of the latest version created before it.
path Parameters
account_idId of the parent account.
ai_agent_idThe agent this is a version of. Fixed by the URL.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: version desc. Sortable: version.
filterAIP-160 subset (§8). Filterable: created_by. A field outside the list is INVALID_ARGUMENT.
List AI agent versions › Responses
One page of versions.
This page of versions, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Get AI agent version
The immutable settings of an agent at one version, written by the update that produced it. create_time is when that version took effect, so the settings in force at any moment are those of the latest version created before it.
path Parameters
account_idId of the parent account.
ai_agent_idThe agent this is a version of. Fixed by the URL.
versionThe version number — also this resource's id, and the version the agent had.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get AI agent version › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
ai_agent_idThe agent this is a version of. Fixed by the URL.
versionThe version number — also this resource's id, and the version the agent had.
snapshotThe agent exactly as it stood at this version: every field of the agent resource, except etag.
created_byThe user whose write produced this version, as users/{user}.