Description: Infernet Client Documentation

Skip to content

# Infernet Client

Infernet Client is a python library as well as a CLI tool. It allows you to:

1. Interact with the Infernet Node's REST API.
2. Interact with the Infernet Router's REST API.
3. Create an Infernet Wallet that can: a. Pay for requested subscriptions b. Receive payments for fulfilled subscriptions.

## Installation

You can either install `infernet-client` via `uv` (Recommended) or via `pip`.

uv pip

    uv pip install infernet-client

    pip install infernet-client

## Commands

You can view all commands with `--help`:

    infernet-client --help

Expected Output:

    Usage: infernet-client [OPTIONS] COMMAND [ARGS]...

    Options:
      --help  Show this message and exit.

    Commands:
      approve        Approve a spender.
      check-model    Check model support.
      containers     List containers running in the network
      create-wallet  Create an Infernet Wallet.
      find           Find nodes running the given containers
      fund           Fund a wallet.
      health         Health check
      ids            Get job IDs for this client.
      info           Get node information.
      job            Request a job.
      resources      Get container resources.
      results        Fetch job results.
      stream         Request a streamed job.
      sub            Request a delegated subscription.
      withdraw       Withdraw tokens.

## Quickstart

You can interact with your Infernet Node using either the CLI or the Python library.

Here's how you can check the server's health:

Python CLI

    from infernet_client import NodeClient

    client = NodeClient("http://localhost:4000")
    is_healthy = await client.health()

    print(is_healthy)

Expected Output:

    True

    export SERVER_URL=http://localhost:4000

    infernet-client health

Expected Output:

    healthy

## Next Steps

- See examples of the available commands and options in the Usage section.

- Check out the library's source code.