Skip to main content

Gumloop Python Client

A Python client for the Gumloop API that makes it easy to run and monitor Gumloop flows, plus the gumloop CLI.

CLI

Install on macOS or Linux:

curl -fsSL https://gumloop.com/cli/install.sh | sh

The installer is fully self-contained under ~/.gumloop — it ships its own Python, never touches your system Python, and needs no sudo. Run gumloop --help to get started and update any time with:

gumloop update

Import your browser sign-ins into a browser profile

Gumloop agents that use the Browser ability keep their sign-ins in a browser profile. Import the sites you are already signed into locally (Chrome, Brave, Edge, Chromium, Arc, Firefox on macOS or Linux) without an extension. By default every site in the local browser profile you pick comes across; you see the sites and cookie counts and confirm before anything is sent:

gumloop browser import-logins                                          # every site, into your personal default profile
gumloop browser import-logins --browser brave --exclude-domain doubleclick.net
gumloop browser import-logins --include-domain github.com --include-domain linear.app
gumloop browser import-logins --url https://mail.google.com --team <team_id> --into 'Ops inbox'   # one site
gumloop browser profiles list

Or, without installing anything first (set GUMLOOP_LOGIN_URL to import a single site, GUMLOOP_EXCLUDE_DOMAINS / GUMLOOP_INCLUDE_DOMAINS to narrow a whole-profile import):

curl -fsSL https://gumloop.com/cli/import-logins.sh | sh

Cookies only: local storage and IndexedDB stay on your machine, so sites that keep the session there ask the agent to sign in once, after which the agent's browser keeps it. Imported cookies are encrypted with the profile's own key before storage and are never shown back in the UI or API; sign-ins the agent picks up while running are saved back to the same profile. Rename, remove sites from, or delete profiles on the Secrets page in Gumloop.

Sync a folder into your Brain

Mirror a local directory into a file-upload Brain source. Files are compared by name and sha256, so a re-run uploads only what changed; indexing starts on its own after each upload.

gumloop brain sync ./docs --create "Engineering docs"                 # personal source
gumloop brain sync ./docs --source <source_id> --prune                # existing source, delete remote files that are gone locally
gumloop brain sync ./runbooks --create "Runbooks" --team-id <team_id> # team source
gumloop brain sync ./policies --create "Policies" --scope organization --require-approval --approve
gumloop brain sources list
gumloop brain files list <source_id>
gumloop brain search "expense policy"

--require-approval creates the source as a draft that only estimates credits; gumloop brain sources estimate <source_id> shows the number and gumloop brain sources approve <source_id> (or --approve) starts indexing. Without it the source is active and indexes on the first upload.

SDK

To use the client as a library in your own Python project:

uv add gumloop

Usage

from gumloop import GumloopClient

# Initialize the client
client = GumloopClient(
    api_key="your_api_key",
    user_id="your_user_id"
)

# Run a flow and wait for outputs
output = client.run_flow(
    flow_id="your_flow_id",
    inputs={
        "recipient": "example@email.com",
        "subject": "Hello",
        "body": "World"
    }
)

print(output)

Authenticate with a team API key

Team (workspace) API keys are scoped to a single team. Pass the team's ID and the acting member's user ID — every request is validated against that team and only reaches resources the team owns.

from gumloop import Gumloop

client = Gumloop(
    api_key="your_team_api_key",
    user_id="your_user_id",  # must be a member of the team
    team_id="your_team_id",
)

agents = client.agents.list()  # scoped to the team

team_id can also be provided via the GUMLOOP_TEAM_ID environment variable.

Chat with an agent (streaming)

import asyncio

from gumloop import AsyncGumloop


async def main() -> None:
    async with AsyncGumloop(access_token="your_access_token") as client:
        agents = await client.agents.list()
        agent = agents.agents[0]

        async for event in client.sessions.stream(
            agent.id,
            input="Hello, what can you do?",
        ):
            print(event)


asyncio.run(main())

Route a task to the right model

Ask Gumloop Chew which of your candidate models should handle a task. Decision only — nothing runs.

from gumloop import Gumloop

client = Gumloop(api_key="your_api_key", user_id="your_user_id")

decision = client.models.route(
    input="Summarize this email thread and draft a reply",
    models=["gpt-5.6-luna", "x-ai/grok-4.6", "claude-opus-5"],
)

print(decision.route.model, decision.route.lane, decision.route.fallback_models)

Omit models to route across the full Chew catalog. Each call bills one small classifier completion.

Put files into your Brain

from gumloop import Gumloop

client = Gumloop(api_key="your_api_key", user_id="your_user_id")

source = client.brain.create_source("Engineering docs").source
upload = client.brain.upload_files(source.id, {"handbook.pdf": open("handbook.pdf", "rb").read()})

print([f.status for f in upload.files], upload.rejected)
print(client.brain.search("onboarding checklist").results[0].title)

Every file carries its sha256, so client.brain.list_files(source.id) is enough to diff a local folder against the source. Only file-upload sources can be created through the API; Notion, Drive and other connected sources are set up in the Gumloop app.

Metadata

Release files for gumloop 0.5.3

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

Source distribution (sdist)

Source distribution for gumloop 0.5.3
File Size Uploaded
gumloop-0.5.3.tar.gz 273.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gumloop 0.5.3
File Interpreter ABI Platform
gumloop-0.5.3-py3-none-any.whl Python 3 none any Details

Total release size: 416.4 kB

Release files / gumloop-0.5.3.tar.gz

Download URL gumloop-0.5.3.tar.gz
Size 273.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2f7ad26190419330f74a7a80dbb9e01a32d4e5f2533df6cc280a68252ad1428a
BLAKE2b-256 checksum
How to use checksums
c7679f8536327e4e4e501b7c5200859a75e78df8b2c8301dcdb350fca5b716f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gumloop-0.5.3-py3-none-any.whl

Download URL gumloop-0.5.3-py3-none-any.whl
Size 142.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2518bddfa05ea4e16d092d2578d49ade5472a3ce334e46b5399cab0cf2a1e30
BLAKE2b-256 checksum
How to use checksums
7e67990c2e69d872b792a0736711c5dfa0ff9448e0158ca27d2ce94f3dcf7235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.5.5

2 release files

0.5.4

2 release files

This release

0.5.3 This release

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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