It is possible to use :ref:`Zyte API <zyte-api>` without a Zyte API account by using the x402 protocol to handle payments:
- Read the Zyte Terms of Service. By using Zyte API, you are accepting them.
- During :ref:`installation <install>`, make sure to install the
x402extra. - :ref:`Configure <eth-key>` the private key of your Ethereum account to authorize payments.
It is recommended to configure your Ethereum private key through an environment variable, so that it can be picked by both the :ref:`command-line client <command_line>` and the :ref:`Python client library <api>`:
On Windows’ CMD:
> set ZYTE_API_ETH_KEY=YOUR_ETH_PRIVATE_KEY
On macOS and Linux:
$ export ZYTE_API_ETH_KEY=YOUR_ETH_PRIVATE_KEY
Alternatively, you may pass your Ethereum private key to the clients directly:
To pass your Ethereum private key directly to the command-line client, use the
--eth-keyswitch:zyte-api --eth-key YOUR_ETH_PRIVATE_KEY …
To pass your Ethereum private key directly to the Python client classes, use the
eth_keyparameter when creating a client object:from zyte_api import ZyteAPI client = ZyteAPI(eth_key="YOUR_ETH_PRIVATE_KEY")
from zyte_api import AsyncZyteAPI client = AsyncZyteAPI(eth_key="YOUR_ETH_PRIVATE_KEY")