Skip to main content

ai_agents_agents

Creates, updates, deletes, gets or lists an ai_agents_agents resource.

Overview​

Nameai_agents_agents
TypeResource
Idovh.public_cloud.ai_agents_agents

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstringUnique identifier of the AI agent
created_atstring (date-time)Date of the AI agent creation (wire: createdAt)
current_stateobjectCurrent state of the AI agent (wire: currentState)
resource_statusstringReflects the readiness of the AI agent: READY, SUSPENDED when it is paused, or DELETING on the response to its deletion (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus)
target_specobjectLast target specification of the AI agent (wire: targetSpec)
updated_atstring (date-time)Date of the last AI agent update (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectagent_id, project_idGet an AI agent
listselectproject_idx_pagination_cursor, x_pagination_sizeList AI agents
createinsertproject_id, target_specCreates an AI agent: a hosted assistant that answers on its own URL, given by currentState.endpointUrl, and reached with a token from the token action. An agent runs a model with a persona, plus whatever tools, memory and channels its configuration gives it. That configuration can come from a ready-made one published by OVHcloud, from a template of your own, or from settings supplied here — or from none of them, leaving an agent that cannot answer until it is given a model. Parts of it that OVHcloud manages are rejected here; the globalSettings preset says which. This is the only point at which this API sets an agent's configuration: from here on the agent holds its own and is configured through its endpoint. Create it paused to finish preparing it before it answers anyone.
updateupdateagent_id, project_id, target_spectargetSpec.enabled is mandatory, including on an update whose only intent is a rename. Restating the agent's current running state changes nothing; stating the other one pauses or resumes it. targetSpec.name is optional: omitting it, or restating the current name, leaves it untouched. Any other name renames the agent and redeploys it, keeping its identifier, its access tokens, its configuration and its data, and re-applying its paused state. A name another agent in the project already holds is rejected. The configuration is not settable here; it is read and changed through the agent itself.
deletedeleteagent_id, project_idDeletion is asynchronous: the response describes the agent with resourceStatus: DELETING.
redeployexecagentId, project_idRefreshes the agent's runtime without touching its configuration or the data it holds.
tokenexecagentId, project_idReturns a bearer token to present to the agent at currentState.endpointUrl. The token is returned once, here, and is never readable afterwards. Both body fields are optional: send {} for the defaults, which are the VIEWER role and the agent's own default lifetime. A lifetime longer than the agent's own maximum is rejected.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
agentIdstringAgent ID
agent_idstringAgent ID (wire: agentId)
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Get an AI agent

SELECT
id,
created_at,
current_state,
resource_status,
target_spec,
updated_at
FROM ovh.public_cloud.ai_agents_agents
WHERE agent_id = '{{ agent_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Creates an AI agent: a hosted assistant that answers on its own URL, given by currentState.endpointUrl, and reached with a token from the token action. An agent runs a model with a persona, plus whatever tools, memory and channels its configuration gives it. That configuration can come from a ready-made one published by OVHcloud, from a template of your own, or from settings supplied here — or from none of them, leaving an agent that cannot answer until it is given a model. Parts of it that OVHcloud manages are rejected here; the globalSettings preset says which. This is the only point at which this API sets an agent's configuration: from here on the agent holds its own and is configured through its endpoint. Create it paused to finish preparing it before it answers anyone.

INSERT INTO ovh.public_cloud.ai_agents_agents (
target_spec,
project_id
)
SELECT
'{{ target_spec }}' /* required */,
'{{ project_id }}'
RETURNING
id,
created_at,
current_state,
resource_status,
target_spec,
updated_at
;

UPDATE examples​

targetSpec.enabled is mandatory, including on an update whose only intent is a rename. Restating the agent's current running state changes nothing; stating the other one pauses or resumes it. targetSpec.name is optional: omitting it, or restating the current name, leaves it untouched. Any other name renames the agent and redeploys it, keeping its identifier, its access tokens, its configuration and its data, and re-applying its paused state. A name another agent in the project already holds is rejected. The configuration is not settable here; it is read and changed through the agent itself.

UPDATE ovh.public_cloud.ai_agents_agents
SET
target_spec = '{{ target_spec }}'
WHERE
agent_id = '{{ agent_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND target_spec = '{{ target_spec }}' --required
RETURNING
id,
created_at,
current_state,
resource_status,
target_spec,
updated_at;

DELETE examples​

Deletion is asynchronous: the response describes the agent with resourceStatus: DELETING.

DELETE FROM ovh.public_cloud.ai_agents_agents
WHERE agent_id = '{{ agent_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Refreshes the agent's runtime without touching its configuration or the data it holds.

EXEC ovh.public_cloud.ai_agents_agents.redeploy
@agentId='{{ agentId }}' --required,
@project_id='{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;