> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerone.run/llms.txt
> Use this file to discover all available pages before exploring further.

# 快速开始

> 安装 SDK 并运行第一个 TypeScript Agent。

# 运行第一个 Agent

SDK 需要 Node.js 22 或更高版本。在已有 Node.js 项目中安装：

```bash theme={null}
npm install @zerone-agent/agent-sdk
```

设置 Provider 凭据：

```bash theme={null}
export ZERONE_AGENT_API_KEY="your-provider-key"
```

创建 `agent.ts`：

```typescript theme={null}
import { createAgent } from "@zerone-agent/agent-sdk";

const agent = createAgent({ model: "claude-sonnet-4-6" });
const result = await agent.prompt("用三点解释 Agent loop。");
console.log(result.text);
await agent.close();
```

运行示例：

```bash theme={null}
npx tsx agent.ts
```

<Warning>示例中的 API key 名称是真实配置入口，但值必须来自环境变量或 secret manager，不能提交到源码。</Warning>

继续阅读 [Agent](/zh/sdk/agents)、[Query](/zh/sdk/query) 和 [Model](/zh/sdk/providers)。
