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.
Create Agents
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/agents"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key, "Content-Type": "application/json",}payload = { "name": "string", "commitMessage": "string", "workflowId": "string", "copiedFromAgentId": "string", "type": "signature", "config": { "_library_ref": "string", "name": "string", "description": "string", "cls": "string", "parameters": [ { "identifier": "string", "type": "str", "optional": False, "value": None, "desc": "string", "prefix": "string", "hidden": False, "json_schema": {}, }, ], "inputs": [ { "identifier": "string", "type": "str", "optional": False, "value": None, "desc": "string", "prefix": "string", "hidden": False, "json_schema": {}, }, ], "outputs": [ { "identifier": "string", "type": "str", "optional": False, "value": None, "desc": "string", "prefix": "string", "hidden": False, "json_schema": {}, }, ], "isCustom": False, "behave_as": "evaluator", "configId": "string", "handle": "string", "versionMetadata": { "versionId": "string", "versionNumber": 0, "versionCreatedAt": "string", }, "llm": { "model": "string", "temperature": 0, "max_tokens": 0, "top_p": 0, "frequency_penalty": 0, "presence_penalty": 0, "seed": 0, "top_k": 0, "min_p": 0, "repetition_penalty": 0, "reasoning": "string", "reasoning_effort": "string", "thinkingLevel": "string", "effort": "string", "verbosity": "string", "litellm_params": {}, }, "prompt": "string", "messages": [ { "role": "system", "content": "string", }, ], "promptDraft": False, },}response = requests.post( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/agents";const response = await fetch(url, { method: "POST", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ "name": "string", "commitMessage": "string", "workflowId": "string", "copiedFromAgentId": "string", "type": "signature", "config": { "_library_ref": "string", "name": "string", "description": "string", "cls": "string", "parameters": [ { "identifier": "string", "type": "str", "optional": false, "value": null, "desc": "string", "prefix": "string", "hidden": false, "json_schema": {} } ], "inputs": [ { "identifier": "string", "type": "str", "optional": false, "value": null, "desc": "string", "prefix": "string", "hidden": false, "json_schema": {} } ], "outputs": [ { "identifier": "string", "type": "str", "optional": false, "value": null, "desc": "string", "prefix": "string", "hidden": false, "json_schema": {} } ], "isCustom": false, "behave_as": "evaluator", "configId": "string", "handle": "string", "versionMetadata": { "versionId": "string", "versionNumber": 0, "versionCreatedAt": "string" }, "llm": { "model": "string", "temperature": 0, "max_tokens": 0, "top_p": 0, "frequency_penalty": 0, "presence_penalty": 0, "seed": 0, "top_k": 0, "min_p": 0, "repetition_penalty": 0, "reasoning": "string", "reasoning_effort": "string", "thinkingLevel": "string", "effort": "string", "verbosity": "string", "litellm_params": {} }, "prompt": "string", "messages": [ { "role": "system", "content": "string" } ], "promptDraft": false } }),});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/agents' \ --header "X-Auth-Token: $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{"name":"string","commitMessage":"string","workflowId":"string","copiedFromAgentId":"string","type":"signature","config":{"_library_ref":"string","name":"string","description":"string","cls":"string","parameters":[{"identifier":"string","type":"str","optional":false,"value":null,"desc":"string","prefix":"string","hidden":false,"json_schema":{}}],"inputs":[{"identifier":"string","type":"str","optional":false,"value":null,"desc":"string","prefix":"string","hidden":false,"json_schema":{}}],"outputs":[{"identifier":"string","type":"str","optional":false,"value":null,"desc":"string","prefix":"string","hidden":false,"json_schema":{}}],"isCustom":false,"behave_as":"evaluator","configId":"string","handle":"string","versionMetadata":{"versionId":"string","versionNumber":0,"versionCreatedAt":"string"},"llm":{"model":"string","temperature":0,"max_tokens":0,"top_p":0,"frequency_penalty":0,"presence_penalty":0,"seed":0,"top_k":0,"min_p":0,"repetition_penalty":0,"reasoning":"string","reasoning_effort":"string","thinkingLevel":"string","effort":"string","verbosity":"string","litellm_params":{}},"prompt":"string","messages":[{"role":"system","content":"string"}],"promptDraft":false}}'Call the LangWatch API from this project: Create an authored agent; connected agents register through the SDK.Request: POST https://app.langwatch.ai/api/v1/agentsReference: https://langwatch.ai/docs/api-reference/agents/create-agents.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{ "name": "string", "commitMessage": "string", "workflowId": "string", "copiedFromAgentId": "string", "type": "signature", "config": { "_library_ref": "string", "name": "string", "description": "string", "cls": "string", "parameters": [ { "identifier": "string", "type": "str", "optional": false, "value": null, "desc": "string", "prefix": "string", "hidden": false, "json_schema": {} } ], "inputs": [ { "identifier": "string", "type": "str", "optional": false, "value": null, "desc": "string", "prefix": "string", "hidden": false, "json_schema": {} } ], "outputs": [ { "identifier": "string", "type": "str", "optional": false, "value": null, "desc": "string", "prefix": "string", "hidden": false, "json_schema": {} } ], "isCustom": false, "behave_as": "evaluator", "configId": "string", "handle": "string", "versionMetadata": { "versionId": "string", "versionNumber": 0, "versionCreatedAt": "string" }, "llm": { "model": "string", "temperature": 0, "max_tokens": 0, "top_p": 0, "frequency_penalty": 0, "presence_penalty": 0, "seed": 0, "top_k": 0, "min_p": 0, "repetition_penalty": 0, "reasoning": "string", "reasoning_effort": "string", "thinkingLevel": "string", "effort": "string", "verbosity": "string", "litellm_params": {} }, "prompt": "string", "messages": [ { "role": "system", "content": "string" } ], "promptDraft": false }}```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"}Request body
application/json · Required
Responses
201Success
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