> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.segmentationapi.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.segmentationapi.com/_mcp/server.

# Authentication

> API key authentication, required headers, and rate limits for SegmentationAPI endpoints.

Every customer request needs `Authorization: Bearer`. Use an unrestricted secret (`sk_live_...`) from the [dashboard](https://app.segmentationapi.com), or a Cognito access token. The [`segment` CLI](/cli) manages both (`auth login`, `keys set`). Do not put a secret key in browser code. A live key can run jobs, read usage, manage keys, and start Stripe checkout or portal sessions.

```bash
curl -X POST https://api.segmentationapi.com/v1/uploads/presign \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_SEGMENTATION_API_KEY" \
  -d '{"contentType": "image/png"}'
```

```ts
import { SegmentationAPIClient } from "@segmentationapi/sdk";

const client = new SegmentationAPIClient({
  token: process.env.SEGMENTATION_API_KEY!,
});
```

A missing or revoked credential returns `401`:

```json
{
  "error": "Unauthorized",
  "message": "Missing or invalid API key"
}
```

Job requests accept 1–100 task IDs (exactly one for video). Pagination uses `limit` up to 100 and `nextToken`. See the [API reference](/api-reference) for the rest of the contract.