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

# Quickstart

> Add a safety layer to your AI actions in minutes.

## 1. Get your API key

Sign up at [safefetch.dev](https://safefetch.dev) to get an API key. Your key looks like `sf_live_...`.

## 2. Install the SDK

```bash theme={null}
npm install safefetch
```

## 3. Send your first action

Set your API key and call `safeFetch()`:

```ts theme={null}
import { safeFetch } from "safefetch";

// SAFEFETCH_API_KEY is read from env automatically
const action = await safeFetch({
  url: "https://api.example.com/send-email",
  body: { to: "user@example.com", subject: "Hello from AI" },
  approve: true,   // pause for human approval before delivery
  retries: 3,
});

console.log(action.id);     // act_01jq...
console.log(action.status); // "awaiting_approval"
```

## 4. Response shape

Every `safeFetch()` call returns an **action object**:

```json theme={null}
{
  "id": "act_01jq...",
  "status": "awaiting_approval",
  "url": "https://api.example.com/send-email",
  "method": "POST",
  "body": { "to": "user@example.com", "subject": "Hello from AI" },
  "approve": true,
  "retries": 3,
  "attempts": 0,
  "created_at": "2025-01-01T00:00:00.000Z"
}
```

Once approved, `status` moves to `"active"` then `"completed"`. A completed action also includes `response_code`, `response_body`, and `duration_ms`.

## Next steps

* [Human approval guide](/guides/human-approval) — approve actions via API, CLI, or dashboard
* [API Reference](/api-reference/overview) — full endpoint documentation
