Creates an agent with the given metadata, runtime configuration, and optional file tree. Returns the agent’s identity, ownership, and a revision token identifying the initial file tree. Creation is atomic — either the agent is fully created or no state is persisted.
The file tree is built from typed fields:
system_prompt → AGENTS.md (instructions is a
deprecated alias; system_prompt wins when both are sent)tools → tools.jsonsubagents[i] → subagents/<name>/AGENTS.md + subagents/<name>/tools.jsonskills[i] → skills/<name>/SKILL.md + supporting filesAll file paths in skills[i].files and the top-level files map
must be relative — no leading /, no .. segments.
extras is an arbitrary key/value map for caller-defined tracking
attached to the agent’s metadata.
Use files for paths the typed fields don’t cover. Setting both
a typed field and the corresponding files entry returns 422.
Documentation Index
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
Use this file to discover all available pages before exploring further.
Echo the agent's file tree in the response
Caller-defined key/value tracking merged into the agent's runtime configuration. Typed runtime fields win on key collision.
Caller-defined key/value tracking attached to the agent's metadata.
Raw file map for paths the typed fields don't cover. Setting a typed
field and the corresponding files entry returns 422.
Deprecated: use system_prompt. Accepted for backwards compatibility;
system_prompt takes precedence when both are set.
Skills. Each entry is written to skills/<name>/SKILL.md and supporting files.
Subagents. Each entry is written to subagents/<name>/AGENTS.md and subagents/<name>/tools.json.
Agent system prompt. Written to AGENTS.md.
"You are a helpful agent. Use the available tools to answer the user's question."
Tool config. Written to tools.json.
Created
READ, RUN, WRITE Raw file map. Returned only when include_files=true.
Deprecated: use system_prompt. Echoed alongside system_prompt with
the same value for backwards compatibility.
Skills parsed from skills/<name>/SKILL.md and supporting files.
Subagents parsed from subagents/<name>/AGENTS.md + subagents/<name>/tools.json.
Agent system prompt parsed from AGENTS.md.
Tool config parsed from tools.json.