Generate from a prompt
Agent.create starts a build; it does not return a completed agent definition. Prompt length is 3–500 characters; put longer instructions in context. Depth may be standard or deep. Save buildId in TypeScript or build_id in Python immediately. See either language quickstart for a complete example.
Wait and resume
typescript
import { Agent } from '@parcha/agentrun';
const agent = new Agent({ apiKey: process.env.AGENTRUN_API_KEY!, buildId: savedBuildId });
await agent.waitUntilReady();
console.log(agent.id);python
from agentrun import Agent
agent = Agent(api_key=key, build_id=saved_build_id)
agent.wait_until_ready()
print(agent.id)Both run methods wait for build readiness automatically. A local timeout does not cancel generation. Resume the saved build instead of starting another one.
Define an agent directly
typescript
const agent = new Agent({
apiKey: process.env.AGENTRUN_API_KEY!,
name: 'Verifier', instructions: 'Verify claims and cite primary sources.',
});
const id = await agent.create();python
from agentrun import AgentRun
client = AgentRun(api_key=key)
record = client.create_agent(name="Verifier", instructions="Verify claims and cite primary sources.")
agent = client.agent(record["id"])A manual definition avoids a generation job. Definitions may include skills and tools returned by their catalogs. Save the ID, then reuse it for subsequent runs. Use getAgent/updateAgent/deleteAgent or get_agent/update_agent/delete_agent to manage the saved definition. Agent creation is not automatically retried after ambiguous failures.