SDK
Python SDK
Use the Python client for server-side assistants, LangChain flows, and backend workers.
Install after registry publication
Public PyPI installation is a post-publication launch gate. Until `sdk:registries:verify` passes, use the workspace package in local development.
pip install thegenesis-api-clientAuth and client setup
import os
from genesis import GenesisClient, GenesisConfig
genesis = GenesisClient(
GenesisConfig(
api_key=os.environ["GENESIS_API_KEY"],
mode="test",
timeout_seconds=0.15,
)
)Request offers
from genesis import OfferRequest, hash_identifier
response = genesis.request_offers(
OfferRequest(
placement_id="chat_recommendation_after_answer",
app_id="app_python_docs",
user_id_hash=hash_identifier("internal-user-id"),
message="I need SOC 2 monitoring for a SaaS company.",
categories=["security_compliance", "developer_tools"],
max_offers=2,
)
)Tracking
offer = response["offers"][0]
genesis.track_impression(offer)
genesis.track_click(offer)Treat no-fill as an expected response, never send raw PII, and render a clear sponsored label for every returned offer.