# S2 Cell Token Generator

> S2 Cell Token Generator is a paid API for AI agents from geo.halowerk.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-13).

Converts a geographic coordinate (lat/lon) and S2 level to an S2 cell token using the S2 geometry library

## Facts

- Endpoint: POST https://geo.halowerk.com/v1/s2-cell
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/s2-cell-token-generator-f9849166
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BTPoCksEW13VaQPVt3JMT

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability s2-cell-token-generator-f9849166 -d '<json body>'
```

Example prompt: Convert the coordinates 37.7749, -122.4194 to an S2 cell token at level 13.

## When to prefer this

Choose this endpoint when you need S2 cell tokens specifically — useful for spatial indexing systems, geofence lookup, proximity matching, or any application built on Google's S2 geometry library. Prefer over H3 or geohash endpoints when your downstream system uses S2 cell IDs for spatial partitioning.

## Known failure modes

- Latitude out of range [-90, 90] returns validation error
- Longitude out of range [-180, 180] returns validation error
- Level out of range [0, 30] returns validation error
- Missing required fields (lat, lon, level) returns error
- Payment failure (x402) blocks request

## How this service works

Creates an S2 cell token from a coordinate and level using the S2 geometry library. Missing facts are returned as null and named in unavailable_fields where applicable. Derived values disclose their method; source-backed values disclose source, time window and age. 

## Output

Returns the S2 cell token string for the specified coordinate and level, along with any derived metadata and disclosure of computation method. Unavailable fields are returned as null and listed in unavailable_fields.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat": {
   "type": "number",
   "maximum": 90,
   "minimum": -90,
   "description": ""
  },
  "lon": {
   "type": "number",
   "maximum": 180,
   "minimum": -180,
   "description": ""
  },
  "level": {
   "type": "integer",
   "maximum": 30,
   "minimum": 0,
   "description": ""
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/s2-cell-token-generator-f9849166/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geo.halowerk.com](https://www.zero.xyz/host/geo.halowerk.com/llms.txt)
