import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const agentView = await client.agents.create({ name: 'name', version: 'version' });
console.log(agentView.id);{
"id": "<string>",
"name": "<string>",
"version": "<string>",
"create_time_ms": 123,
"is_public": true,
"source": {
"type": "<string>",
"npm": {
"package_name": "<string>",
"registry_url": "<string>",
"agent_setup": [
"<string>"
]
},
"pip": {
"package_name": "<string>",
"registry_url": "<string>",
"agent_setup": [
"<string>"
]
},
"object": {
"object_id": "<string>",
"agent_setup": [
"<string>"
]
},
"git": {
"repository": "<string>",
"ref": "<string>",
"agent_setup": [
"<string>"
]
}
}
}Create a new Agent with a name and optional public visibility. The Agent will be assigned a unique ID.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const agentView = await client.agents.create({ name: 'name', version: 'version' });
console.log(agentView.id);{
"id": "<string>",
"name": "<string>",
"version": "<string>",
"create_time_ms": 123,
"is_public": true,
"source": {
"type": "<string>",
"npm": {
"package_name": "<string>",
"registry_url": "<string>",
"agent_setup": [
"<string>"
]
},
"pip": {
"package_name": "<string>",
"registry_url": "<string>",
"agent_setup": [
"<string>"
]
},
"object": {
"object_id": "<string>",
"agent_setup": [
"<string>"
]
},
"git": {
"repository": "<string>",
"ref": "<string>",
"agent_setup": [
"<string>"
]
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Agent created successfully. Returns the Agent with metadata.
An Agent represents a registered AI agent entity.
The unique identifier of the Agent.
The name of the Agent.
The version of the Agent. A semver string (e.g., '2.0.65') or a SHA.
The creation time of the Agent (Unix timestamp milliseconds).
Whether the Agent is publicly accessible.
The source configuration for the Agent.
Show child attributes
Was this page helpful?