Emend
API Reference

Initialization & Authentication

EmendClient setup for Hosted Enterprise and Local OSS.

EmendClientclass

The main client class for interacting with the Emend API. The same EmendClient works against both deployment modes — only the install package, the URL, and whether you need an API key change.

from emend import EmendClient client = EmendClient()  # uses EMEND_API_KEY env var
PropType
url_endpointstring
api_keystring
timeoutfloat

The SDK and CLI share one URL env var. Both the Python client and the emend CLI read EMEND_URL, defaulting to https://www.emend.online/. Set it once (or pass --server-url / url_endpoint explicitly) and both tools agree.

Setup

Hosted Enterprise

Info
The hosted endpoint at https://www.emend.online and API key authentication require an Emend Enterprise account.

Hosted Enterprise registration is open — no invitation required. If you do not have an account yet, create one from the registration page with email and password (then verify your email) or sign up with Google.

Install the lightweight client package — it has only the SDK and a handful of pure-Python deps:

pip install emend-client

Set your API key as an environment variable, then create the client with no arguments:

export EMEND_API_KEY="your-api-key"
from emend import EmendClient client = EmendClient()  # url defaults to https://www.emend.online/ # Ready to use immediatelyresponse = client.get_config()

You can also pass the API key directly:

client = EmendClient(api_key="your-api-key")
Store your API key
API keys are shown only once when created. Store the value somewhere secure, because the web portal only displays the saved prefix afterward. If a key is lost, create a new key and delete the old one.

Local OSS

Install the full open-source package — it bundles the client, the FastAPI server, and the emend CLI:

pip install emend-ai

Start the local server:

emend services start  # listens on http://localhost:8081

Point the client at it. No API key is needed — the open-source server runs without authentication by default.

from emend import EmendClient client = EmendClient(url_endpoint="http://localhost:8081") # Ready to use immediatelyresponse = client.get_config()

Or use the env var:

export EMEND_URL="http://localhost:8081" from emend import EmendClient client = EmendClient()  # auto-reads EMEND_URL

Environment variables

Variables the Python client reads. Explicit constructor parameters always take precedence.

VariablePurpose
EMEND_API_KEYAPI key for authentication. Required for Hosted Enterprise; not required by default for Local OSS. API keys are shown only once when created.
EMEND_URLBase URL for the API. Defaults to Hosted Enterprise at https://www.emend.online/. Set to http://localhost:8081 for Local OSS.

The emend CLI reads the same EMEND_URL env var, so a single setting configures both the SDK and the CLI. See the CLI Reference for details.

Client Behavior

Sync and native async API

The client remains synchronous by default. publish_interaction_async() and search_async() are native async counterparts for hosted async integrations; await them directly. Both use the same request construction, response models, and configured total timeout as their synchronous counterparts.

Fire-and-Forget Mode

Several methods use fire-and-forget by default: the call returns None immediately and the operation runs in the background. Set wait_for_response=True to block until the server confirms.

Methods with optional fire-and-forget (wait_for_response=False by default):

  • delete_interaction
  • delete_profile
  • delete_request
  • delete_session
  • delete_agent_playbook
  • delete_user_playbook
  • rerun_profile_generation
  • rerun_playbook_generation
  • run_playbook_aggregation

Methods that are always fire-and-forget (no blocking option):

  • manual_profile_generation
  • manual_playbook_generation
Info
publish_interaction always blocks on the HTTP round-trip and returns a PublishUserInteractionResponse — the wait_for_response flag controls only whether the server processes extraction synchronously before returning, not the client transport.

Caching

get_profiles and get_agent_playbooks cache results locally for 10 minutes. After publishing new data, pass force_refresh=True to bypass the cache and fetch fresh results.