# Quickstart: Claude Agent SDK

**You need:** Node.js 20 or later, `@anthropic-ai/claude-agent-sdk` (pin the version you install), an Anthropic API
key in `ANTHROPIC_API_KEY`, and a Restolayer key in `LG_API_KEY`.

1. **Get a key.** Sign up at https://app.restolayer.com/sign-up. An owner creates a key in Settings → API keys and picks its scopes: `gateway:read` to read keys, credits and usage, plus `gateway:write` to change them. Keep it in an environment variable, never in a file you commit:

   ```bash
   export LG_API_KEY=lg_live_…
   ```
2. **Install** (pinned):

   ```bash
   npm install --save-exact @anthropic-ai/claude-agent-sdk
   ```
3. **Give the agent the server:**

   ```ts
   import { query } from "@anthropic-ai/claude-agent-sdk";

   for await (const message of query({
     prompt: "Which organization am I in, and which workspaces does it have?",
     options: {
       mcpServers: {
         restolayer: { type: "http", url: "https://manage.restolayer.com/mcp", headers: { Authorization: `Bearer ${process.env.LG_API_KEY}` } },
       },
       allowedTools: ["mcp__restolayer__lg_whoami", "mcp__restolayer__lg_workspaces_list"],
     },
   })) {
     if (message.type === "result") console.log(message.result);
   }
   ```
4. **Check it.** The answer names the organization and its workspaces, read with your key's scopes.

Next: [task recipes](https://www.restolayer.com/docs/recipes), [the MCP tools](https://www.restolayer.com/docs/mcp/tools), and
[what an agent can do alone](https://www.restolayer.com/for-agents).
