import requests
url = "https://app.langwatch.ai/api/v1/agents/{id}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/v1/agents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/v1/agents/{id} \
--header 'X-Auth-Token: <api-key>'{
"id": "<string>",
"name": "<string>",
"type": "signature",
"config": {},
"environment": "<string>",
"ownerUserId": "<string>",
"hostLabel": "<string>",
"lastSeenAt": "<string>",
"parameters": [
{
"name": "<string>",
"description": "<string>",
"defaultValue": "<string>",
"secret": true,
"type": "string",
"options": [
"<string>"
],
"required": true
}
],
"owner": {
"userId": "<string>",
"name": "<string>"
},
"status": "online",
"instances": [
{
"instanceId": "<string>",
"hostname": "<string>",
"username": "<string>",
"pid": 123,
"label": "<string>",
"sdk": {
"name": "<string>",
"version": "<string>",
"language": "<string>"
},
"connectedAt": "<string>",
"inflight": 123,
"maxConcurrency": 123
}
],
"selectable": true,
"notSelectableReason": "owned_by_another_person",
"createdAt": "<string>",
"updatedAt": "<string>",
"platformUrl": "<string>"
}Get Agents
Read one agent with its presence, its owner and the run parameters it declares. An id the project does not hold answers 404 agent_not_found.
import requests
url = "https://app.langwatch.ai/api/v1/agents/{id}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/v1/agents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/v1/agents/{id} \
--header 'X-Auth-Token: <api-key>'{
"id": "<string>",
"name": "<string>",
"type": "signature",
"config": {},
"environment": "<string>",
"ownerUserId": "<string>",
"hostLabel": "<string>",
"lastSeenAt": "<string>",
"parameters": [
{
"name": "<string>",
"description": "<string>",
"defaultValue": "<string>",
"secret": true,
"type": "string",
"options": [
"<string>"
],
"required": true
}
],
"owner": {
"userId": "<string>",
"name": "<string>"
},
"status": "online",
"instances": [
{
"instanceId": "<string>",
"hostname": "<string>",
"username": "<string>",
"pid": 123,
"label": "<string>",
"sdk": {
"name": "<string>",
"version": "<string>",
"language": "<string>"
},
"connectedAt": "<string>",
"inflight": 123,
"maxConcurrency": 123
}
],
"selectable": true,
"notSelectableReason": "owned_by_another_person",
"createdAt": "<string>",
"updatedAt": "<string>",
"platformUrl": "<string>"
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Path Parameters
The agent id.
1Response
Success
The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API.
signature, code, workflow, http, connected Show child attributes
Show child attributes
The environment a connected agent registered with, for example production or development. Null for every other kind.
The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.
The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.
When an instance of a connected agent was last connected. Null for every other kind.
The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind.
Show child attributes
Show child attributes
The person a personal development agent belongs to. Null when the agent is shared or host-scoped.
Show child attributes
Show child attributes
online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind.
online, offline The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind.
Show child attributes
Show child attributes
Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name.
Why the agent cannot be run by this credential. Null when it can.
owned_by_another_person, null Was this page helpful?