Skip to main content
POST
/
api
/
trpc
/
agent.create
Create Agent
curl --request POST \
  --url https://app.tryiris.dev/api/trpc/agent.create \
  --header 'Content-Type: application/json' \
  --header 'IRIS_ACCESS_TOKEN: <iris_access_token>' \
  --data '
{
  "data": {
    "provider": "<string>",
    "modelType": "<string>",
    "organizationId": "<string>",
    "anthropicApiKey": "<string>"
  }
}
'
[
  {
    "result": {
      "data": {
        "json": {
          "id": "174a0ac6-9d0d-43ad-a2c0-d11e52b36c91",
          "provider": "anthropic",
          "modelType": "claude-3-5-sonnet-20241022",
          "numAgents": 0,
          "isActive": true,
          "anthropicApiKey": null,
          "awsAccessKeyId": null,
          "awsSecretAccessKey": null,
          "awsSessionToken": null,
          "awsRegion": null,
          "apiEndpoint": null,
          "apiKey": null,
          "organizationId": "6ae3ce30-c530-4a80-b9eb-d7acfcf7ee73",
          "createdAt": "2025-01-01T07:06:07.758Z",
          "updatedAt": "2025-01-01T07:06:07.758Z"
        },
        "meta": {
          "values": {
            "createdAt": ["Date"],
            "updatedAt": ["Date"]
          }
        }
      }
    }
  }
]

Create Agent

Create a new AI agent with specified provider and model type.

Headers

IRIS_ACCESS_TOKEN
string
required
Your Iris API access token

Body

data
object
required

Response

Returns the created agent details upon success.
{
  "0": {
    "json": {
      "data": {
        "provider": "<provider>",
        "modelType": "<model-type>",
        "organizationId": "<your-organization-id>",
        "anthropicApiKey": "<your-anthropic-api-key>"
      }
    }
  }
}
[
  {
    "result": {
      "data": {
        "json": {
          "id": "174a0ac6-9d0d-43ad-a2c0-d11e52b36c91",
          "provider": "anthropic",
          "modelType": "claude-3-5-sonnet-20241022",
          "numAgents": 0,
          "isActive": true,
          "anthropicApiKey": null,
          "awsAccessKeyId": null,
          "awsSecretAccessKey": null,
          "awsSessionToken": null,
          "awsRegion": null,
          "apiEndpoint": null,
          "apiKey": null,
          "organizationId": "6ae3ce30-c530-4a80-b9eb-d7acfcf7ee73",
          "createdAt": "2025-01-01T07:06:07.758Z",
          "updatedAt": "2025-01-01T07:06:07.758Z"
        },
        "meta": {
          "values": {
            "createdAt": ["Date"],
            "updatedAt": ["Date"]
          }
        }
      }
    }
  }
]

Response Fields

id
string
Unique identifier for the created agent
provider
string
The AI provider being used
modelType
string
The type of model created
numAgents
number
Number of agents (defaults to 0)
isActive
boolean
Whether the agent is active
organizationId
string
The organization ID associated with the agent
createdAt
date
Timestamp of when the agent was created
updatedAt
date
Timestamp of when the agent was last updated