Skip to main content
 print this page

Create a new custom agent

POST 

/ai/agents

Creates a CUSTOM AgentCore agent. AgentId must be the value returned by GET /ai/agents?action=upload-script, and the zip package must already be uploaded to that presigned URL. Required body fields: AgentId, AgentName, ModelId, Description, PythonVersion, EntryPoint, AgentType (CUSTOM). The API writes CREATING metadata, grants the caller owner access, and triggers asynchronous AgentCore runtime creation. Poll GET /ai/agents/{id} for AgentStatus READY or CREATE_FAILED. Caller must have a valid role_id and AICore enabled. AgentName must be 3-48 alphanumeric and underscore characters starting with a letter (IPV-1004; hyphens are not allowed). Duplicate AgentName returns IPV-1018.

Request

Responses

Agent metadata created and asynchronous AgentCore creation triggered.

Response Headers
    Access-Control-Allow-Origin
    Access-Control-Allow-Methods
    Access-Control-Allow-Headers