# SpicyAPI reference clients

These files are copyable repository examples. They are **not** published npm or
PyPI packages and do not imply a production SLA. Both clients use only their
language runtime, read `SPICY_API_KEY`, use the production API root, impose a
30-second per-request timeout and a ten-minute local polling deadline.

## TypeScript (Node.js 22.6+)

```bash
export SPICY_API_KEY="sk-spicy-..."
node --experimental-strip-types typescript/run-example.ts \
  kie/z-image-spicy "A paper-cut city at dusk"
```

Copy [`typescript/spicy-client.ts`](./typescript/spicy-client.ts) into a
server-side Node project. The example depends only on the built-in Fetch API.

## Python 3.11+

```bash
export SPICY_API_KEY="sk-spicy-..."
python3 python/run_example.py \
  kie/z-image-spicy "A paper-cut city at dusk"
```

Copy [`python/spicy_client.py`](./python/spicy_client.py) into a server-side
Python project. It uses `urllib` and other standard-library modules only.

The ten-minute wait limit is an example-side safety bound. A local timeout does
not prove that a remote generation failed; persist the task ID and reconcile it
later or use signed webhooks.

