# Get pixel

URL: https://docs.hanzo.ai/docs/openapi/event/get-event-pixel-by-key

> Answers a transparent 1x1 GIF and records one page view for the project whose publishable key names the address.

`GET /v1/event/pixel/{key}`

> [Event →](https://docs.hanzo.ai/docs/openapi/event) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                             |
| ------------- | ------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/event/pixel/{key}` |
| **Method**    | `GET`                                       |
| **Operation** | `get_event_pixel_by_key`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`      |

Answers a transparent 1x1 GIF and records one page view for the project whose publishable key names the address:

\<img src="<https://api.hanzo.ai/v1/event/pixel/pk-….gif>" alt="" width="1" height="1">

The page is `?u=` when given, else the Referer. The visitor is stamped from the request like every event, is one visitor for a day, and carries no cookie. Do-not-track and a developer's own machine record nothing. The image is answered whatever happened to the view, with no-store.

## Request

1 field.

| Field | In   | Type   | Required | Description |
| ----- | ---- | ------ | -------- | ----------- |
| `key` | path | string | yes      |             |

## Response

| Status | Body   | Meaning |
| ------ | ------ | ------- |
| `2XX`  | string | Success |

`2XX` body — 1 field.

| Field    | In   | Type            | Always | Description |
| -------- | ---- | --------------- | ------ | ----------- |
| `(body)` | body | string (binary) | yes    |             |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

`hanzo` has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

**SDK**

**.ts**

```ts
import { Configuration, EventApi } from 'hanzoai';

const api = new EventApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getEventPixelByKey({ key: 'key' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EventApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EventApi(client).get_event_pixel_by_key(key='key')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EventAPI.GetEventPixelByKey(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, event_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = event_api::get_event_pixel_by_key(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EventApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new EventApi(client).getEventPixelByKey();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/event/pixel/<key> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **event** through the `event` tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_event_economic"
         }
       }
     }'
```

---

[Event API](https://docs.hanzo.ai/docs/openapi/event) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
