Skip to main content

Everruns SDK for Python

Python SDK for the Everruns API.

Installation

pip install everruns-sdk

Call your agent from code

Use AgentClient to call one agent from an application. It holds an agent key (evr_ak_...) that reaches that agent's session routes and nothing else.

import asyncio
from everruns_sdk import AgentClient


async def main():
    # EVERRUNS_AGENT_URL and EVERRUNS_AGENT_KEY, or pass agent_url= and credential=
    agent = AgentClient()

    # One call: create a session, send, wait for the turn, return the reply text
    print(await agent.run("What is the status of order 42?"))

    # Act for one of your application's users (key needs the `end_user` permission)
    alice = agent.for_end_user("customer-42")
    session = await alice.create_session("Order question")
    await alice.send_message(session["id"], "Where is my package?")
    async for event in alice.stream_events(session["id"], after_sequence=0):
        if event.type == "turn.completed":
            break

    # For a browser or mobile app: hand over a short-lived runtime token, never the key
    token = await alice.runtime_token()
    print(token["access_token"], token["expires_in"])

    await agent.close()


asyncio.run(main())

The same client works against the Everruns server (https://app.everruns.com/api/v1/channels/<channel_id>) and a serve app.

The management client below (Everruns) is for managing Everruns (agents, harnesses, workspaces) with a personal access token. Calling an agent through its sessions.create / messages.create still works but is deprecated and warns once; use AgentClient instead.

Management Quick Start

import asyncio
from everruns_sdk import Everruns


async def main():
    # Uses EVERRUNS_API_KEY and optional EVERRUNS_ORG_ID environment variables
    client = Everruns()

    # Create an agent
    agent = await client.agents.create(
        name="Assistant",
        system_prompt="You are a helpful assistant.",
    )

    # Create a session
    session = await client.sessions.create(agent_id=agent.id)

    # Send a message
    await client.messages.create(session.id, "Hello!")

    # Stream events
    async for event in client.events.stream(session.id):
        if event.type == "output.message.completed":
            print(event.data)
            break

    await client.close()


asyncio.run(main())

Agent Harness

Each agent owns a harness. Set it on create/update with harness_name (preferred) or harness_id (mutually exclusive); omit both to default to the org's generic harness. A session created from the agent runs on the agent's harness.

# Create an agent on a specific harness
agent = await client.agents.create(
    name="researcher",
    system_prompt="You do deep research.",
    harness_name="deep-research",
)

# Agent-first session: no harness needed — it runs on the agent's harness
session = await client.sessions.create(agent_name="researcher")

Harnesses & Models

Discover and manage harnesses, and browse available models to choose a default_model_id.

# Browse harnesses, then create one
harnesses = await client.harnesses.list()  # or .search("research")
harness = await client.harnesses.get(harnesses[0].id)
custom = await client.harnesses.create(
    name="my-harness",
    system_prompt="Base instructions for every session.",
)
examples = await client.harnesses.list_examples()

# List models to pick a default for an agent
models = await client.models.list()

Initial Files

from everruns_sdk import Everruns, InitialFile

client = Everruns()

session = await client.sessions.create(
    agent_id="agent_...",
    initial_files=[
        InitialFile(
            path="/workspace/README.md",
            content="# Demo Project\n",
            encoding="text",
            is_readonly=True,
        ),
        InitialFile(
            path="/workspace/src/app.py",
            content='print("hello")\n',
            encoding="text",
        ),
    ],
)

Runnable example: examples/initial_files.py

Authentication

The SDK uses personal access token authentication. Set EVERRUNS_API_KEY or pass the token explicitly. For personal access tokens with access to multiple organizations, set EVERRUNS_ORG_ID or pass org_id explicitly:

# From environment
client = Everruns()

Or with an explicit token and organization:

client = Everruns(api_key="evr_pat_...", org_id="org_...")

Change Reasons

Record why a change was made. with_reason derives a client that sends the reason with every request it makes; the server stores it in the changed entity's history. The derived client shares the original's connection, and the original stays unchanged:

await client.with_reason("retire the unused agent").agents.delete("agent_123")

scoped = client.with_reason("rotate prompts for the Q3 launch")
await scoped.agents.apply(agent_id, "assistant", "You are concise.")

The reason travels in the Everruns-Change-Reason header, UTF-8 percent-encoded. A blank reason sends no header. The server trims the reason and rejects it with HTTP 400 (invalid_change_reason) when it is longer than 1000 characters, contains control characters other than newline and tab, or looks like it contains a credential. Closing a derived client is a no-op; close the client it came from.

Agent Versions

version = await client.agents.create_version(
    "agent_...",
    change_kind="manual",
    summary="Baseline",
)

versions = await client.agents.list_versions("agent_...")
diff = await client.agents.diff_versions("agent_...", "agentver_1", version.id)
fork = await client.agents.fork_version(
    "agent_...",
    version.id,
    name="forked-agent",
)
rollback = await client.agents.rollback_version(
    "agent_...",
    version.id,
    save_version=True,
)

Workspaces

Workspaces hold files shared across sessions.

workspace = await client.workspaces.create(name="team-docs")

await client.workspace_files.create(
    workspace.id,
    "/notes/welcome.md",
    "# Welcome\n",
    encoding="text",
)
file = await client.workspace_files.read(workspace.id, "/notes/welcome.md")
files = await client.workspace_files.list(workspace.id, recursive=True)

Runnable example: examples/workspaces.py

Memories

Memories are long-term, searchable knowledge stores for agents.

memory = await client.memories.create(name="product-knowledge")

await client.memories.create_file(
    memory.id,
    "/facts/product.md",
    "# Product\n",
    encoding="text",
)
results = await client.memories.grep_files(memory.id, "product")
await client.memories.sync(memory.id)

Runnable example: examples/memories.py

License

MIT

Metadata

Release files for everruns-sdk 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for everruns-sdk 0.3.1
File Size Uploaded Provenance
everruns_sdk-0.3.1.tar.gz 84.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for everruns-sdk 0.3.1
File Interpreter ABI Platform
everruns_sdk-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 118.2 kB

Release files / everruns_sdk-0.3.1.tar.gz

Download URL everruns_sdk-0.3.1.tar.gz
Size 84.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d36a3c4ab89a9f81813a1afb4452790c32dd6a4badc2c4a616661a9c66fea95d
BLAKE2b-256 checksum
How to use checksums
0f2d4ea7005dc28a51074a6bd2d28c540d5408aa30f8a5fee3a9c47245b09dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / everruns_sdk-0.3.1-py3-none-any.whl

Download URL everruns_sdk-0.3.1-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5b67af45f69c416175d87b1915c005e80db84688020e7c37ad140b1ee26d45f
BLAKE2b-256 checksum
How to use checksums
374a9821504281392a24c413e6f996db4164d12b6e58b5e314181072b459d41f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Security for everruns-sdk 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for everruns_sdk-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page