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.
Get Agents
Reads the latest version unless label or version is given. The id also takes a suffix: agent_1:production, agent_1:3 or agent_1:latest.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The agent id.
A deploy label, for example production. Omit both to read the latest version.
A version number.
The response appears below.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/agents/<id>"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.get( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/agents/<id>";const response = await fetch(url, { method: "GET", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request GET \ --url 'https://app.langwatch.ai/api/v1/agents/<id>' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project: Get an agent in the caller's project.Request: GET https://app.langwatch.ai/api/v1/agents/<id>Reference: https://langwatch.ai/docs/api-reference/agents/get-agents.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "id": "string", "name": "string", "type": "signature", "config": {}, "environment": "string", "ownerUserId": "string", "hostLabel": "string", "lastSeenAt": "2026-01-01T00:00:00Z", "parameters": [ { "name": "string", "description": "string", "defaultValue": "string", "secret": false, "type": "string", "options": [ "string" ], "required": false } ], "owner": { "userId": "string", "name": "string" }, "status": "online", "instances": [ { "instanceId": "string", "hostname": "string", "username": "string", "pid": 0, "label": "string", "sdk": { "name": "string", "version": "string", "language": "string" }, "connectedAt": "2026-01-01T00:00:00Z", "inflight": 0, "maxConcurrency": 0 } ], "selectable": false, "notSelectableReason": "owned_by_another_person", "version": 0, "labels": [ { "label": "string", "version": 0 } ], "createdBy": { "id": "string", "name": "string" }, "updatedBy": { "id": "string", "name": "string" }, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-01-01T00:00:00Z", "platformUrl": "string"}Path parameters
idstringrequiredThe agent id.
Query parameters
labelstringA deploy label, for example production. Omit both to read the latest version.
versionintegerA version number.
Responses
200Success
application/json
idstringrequirednamestringrequiredtypestringrequiredThe 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""voice"configobject | nullrequiredenvironmentstring | nullrequiredThe environment a connected agent registered with, for example production or development. Null for every other kind.
ownerUserIdstring | nullrequiredThe user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.
hostLabelstring | nullrequiredThe machine a development agent registered from with a project or service key. Null when the agent is personal or shared.
lastSeenAtstring (date-time) | nullrequiredWhen an instance of a connected agent was last connected. Null for every other kind.
parametersobject[]requiredThe run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind.
ownerobject | nullrequiredThe person a personal development agent belongs to. Null when the agent is shared or host-scoped.
statusstringrequiredonline while at least one process running the connected agent is connected; offline otherwise, and always for every other kind.
"online""offline"instancesobject[]requiredThe processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind.
selectablebooleanrequiredWhether 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.
notSelectableReasonstring | nullrequiredWhy the agent cannot be run by this credential. Null when it can.
versioninteger | nullrequiredThe version this response shows: the latest, unless a label or a version was asked for. Null for connected agents, which are versioned by their code.
labelsobject[]requiredThe deploy labels the agent carries, such as production, and the version each points at.
createdByobject | nullrequiredThe user who created the agent. Null when an API key created it, or it predates creators being recorded.
updatedByobject | nullrequiredThe user who changed the agent last. Null when an API key changed it.
createdAtstring (date-time)requiredupdatedAtstring (date-time)requiredplatformUrlstring (uri)required