glean-api-client
Python Client SDK Generated by Speakeasy.
What it is and what it does
glean-api-client is a Python SDK generated by Speakeasy that wraps Glean's REST API, offering type-safe access to both the Client API (for search and retrieval) and the Indexing API (for content and permission management). It is built on httpx for HTTP transport and pydantic for request/response validation, and supports both blocking and async workflows via the same client instance.
Developers use it to integrate Glean search and indexing into Python applications without manually constructing HTTP requests. The SDK includes full type hints for all parameters and responses, making it suitable for IDEs with Pydantic support (especially PyCharm with the Pydantic plugin). It handles authentication via API tokens, supports streaming responses, and provides retry and error-handling mechanisms.
Use it for:
- Build a Python web app that searches Glean content and displays results to end users via the Client API.
- Index documents and manage permissions in Glean programmatically from a Python backend service.
- Stream chat or search responses asynchronously in a FastAPI or async Python application.
- Automate bulk document indexing or permission updates using the Indexing API in a scheduled job.
- Integrate Glean search into a Python CLI tool or data pipeline for internal knowledge retrieval.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python SDK for accessing Glean's REST API, providing type-hinted access to both Client and Indexing namespaces with support for synchronous and asynchronous operations.
Yes, if you are already using Glean and need Python integration. The package is actively maintained, has low install friction, and provides a well-typed interface to both major Glean API namespaces. However, verify the license terms first—the package metadata does not declare a license, which is a notable gap for production adoption. No known vulnerabilities are recorded.
Install
glean-api-client on PyPI
pip
pip install glean-api-clientuv
uv add glean-api-clientpoetry
poetry add glean-api-clientInstalling glean-api-client
Before you install
Low friction installation via pip or poetry. The package is actively maintained with a recent release (7 days old) and depends on three well-established libraries: httpx, httpcore, and pydantic. Supports Python 3.10 through 3.14.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms in the repository before adopting this package in proprietary or copyleft-sensitive projects.
Quickstart
from glean.api_client import Glean, models
import os
with Glean(api_token=os.getenv("GLEAN_API_TOKEN", "")) as glean:
res = glean.client.chat.create(messages=[
{"fragments": [models.ChatMessageFragment(text="query")]}
])
print(res)
Requires Python 3.10 or later. A valid Glean API token and server URL must be provided; different token types are required for Client vs. Indexing API namespaces.
Verify before relying
- Whether the package is open-source or proprietary, and under what license terms it is distributed.
- Whether the Glean service itself (backend) is self-hosted, SaaS-only, or both.
- Rate limits, retry behavior, and timeout defaults beyond what the description mentions.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — httpcore, httpx, pydantic |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,405/month — #12,702 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: glean_api_client-0.15.5-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
glean-sdkGlean SDK is Mozilla's telemetry collection…
unclear · top 15,000 on PyPI
cloudflareProvides a Python client library for the…
permissive · top 5,000 on PyPI
typesensePython client library for Typesense search…
permissive · top 5,000 on PyPI
prelude-python-sdkProvides a typed Python client for the Prelude…
permissive · top 5,000 on PyPI
linkup-sdkA Python client library for the Linkup API that…
permissive · top 15,000 on PyPI
algoliasearchA Python HTTP client for interacting with…
permissive · top 5,000 on PyPI
glean-parserParses and validates Glean telemetry…
unclear · top 15,000 on PyPI
orq-ai-sdkA type-safe Python SDK for the orq.ai API,…
unclear · top 15,000 on PyPI
openrouterA Python SDK for accessing 400+ AI models…
permissive · top 5,000 on PyPI
dtA Python client for the Dynatrace REST API with…
permissive · top 15,000 on PyPI