# Quickstart

> Three steps, one image URL. Create a publishable key, drop it into an `<img>` tag, and watch your people rows fill in. No SDK, no migration, no schema change.

Free preview, no card required. ~120ms median response. 1,000 free requests per month.

## 1. Create a publishable key

From the console, open **API Keys** and create a new key. Publishable keys are prefixed `pk_` and are safe to ship in a browser `<img>` tag. Lock them to your domains in the key's settings so nobody else can hot-link your quota.

```
# Publishable keys look like this, safe for the browser:
pk_live_7f3e21bc94aa…
```

## 2. Add one image URL

Drop the URL into any place your product renders a person: the row in your CRM, the assignee chip, the comment header. Pass either `linkedin_url` (full URL) or `username` (LinkedIn handle).

```html
<img
  src="https://avtrz.dev/v1/avatar?key={PK_KEY}&linkedin_url={URL}&size=128"
  width="64" height="64"
  alt=""
/>
```

```jsx
function Avatar({ linkedinUrl, name }) {
  const src = `https://avtrz.dev/v1/avatar?key=${PK_KEY}&linkedin_url=${linkedinUrl}&size=128`;
  return (
    <img src={src} alt={name} width={64} height={64} loading="lazy" />
  );
}
```

```shell
curl "https://avtrz.dev/v1/avatar?username=alex-rivera&size=128" \
  -H "x-api-key: $AVTRZ_KEY" \
  -L -o alex.webp
```

The endpoint responds with `302 → image/webp` and `Cache-Control: public, max-age=86400`.

## 3. Watch the row fill in

On the first request Avtrz finds the photo and `302`-redirects the browser to a CDN URL (~120ms). Every subsequent request to the same profile is a CDN hit. You do not have to think about caching.

That is it. Three steps, one URL.

## Common options

Three parameters cover every integration. Full detail on the [API reference](https://avtrz.dev/docs/api/avatar).

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | Required | Your publishable (`pk_`) or secret (`sk_`) API key. |
| `linkedin_url` | string | Optional | Full LinkedIn profile URL. One of `linkedin_url` or `username` is required. |
| `username` | string | Optional | LinkedIn handle (the path segment after `/in/`). Used when you do not have the full URL. |
| `size` | enum: 32 \| 64 \| 128 \| 256 \| 512 | Optional | Output square side, in pixels. Defaults to `128`. |

## Where to go next

- [How it works](https://avtrz.dev/docs/how-it-works): The four-stage lookup of match, decode, encode, cache.
- [Authentication](https://avtrz.dev/docs/auth): Move the lookup to your server with a secret key, and rotate keys safely.
