{"id":23793,"library":"glean-api-client","title":"Glean API Client","description":"Python SDK for Glean's enterprise search and AI assistant APIs, generated by Speakeasy. Current version: 0.12.24. Rapidly evolving; release cadence is weekly or upon spec changes.","status":"active","version":"0.12.24","language":"python","source_language":"en","source_url":"https://github.com/gleanwork/api-client-python","tags":["speakeasy","glean","enterprise-search","api-client","sdk"],"install":[{"cmd":"pip install glean-api-client","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client used by the SDK","package":"httpx","optional":false},{"reason":"Data validation and serialization","package":"pydantic","optional":false}],"imports":[{"note":"Top-level client class.","wrong":null,"symbol":"Glean","correct":"from glean_api_client import Glean"},{"note":"Error models are under models.errors, not top-level errors.","wrong":"from glean_api_client.errors import ServerValidationError","symbol":"ServerValidationError","correct":"from glean_api_client.models.errors import ServerValidationError"}],"quickstart":{"code":"import os\nfrom glean_api_client import Glean\nfrom glean_api_client.models import shared\n\nclient = Glean(\n    access_token=os.environ.get('GLEAN_ACCESS_TOKEN', ''),\n    server_url='https://my-glean-instance.glean.com'\n)\n\nsearch_req = shared.SearchRequest(\n    query='sales report 2025',\n    page_size=10\n)\nresp = client.search.search(search_req)\nprint(resp.dict() if resp else 'No results')","lang":"python","description":"Initialize the client with an API token and perform a basic search."},"warnings":[{"fix":"Use keyword argument: `Glean(access_token='token')`.","message":"In 0.11.x, the client initialization changed from positional arguments to keyword-only. Using `Glean('token')` will fail.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Use `shared.Facet` and `shared.Filter` in search requests.","message":"All 'deep' search and advanced filter parameters are deprecated in favor of the new `Facet` and `Filter` objects.","severity":"deprecated","affected_versions":">=0.12.0"},{"fix":"Always use dot notation on response objects; avoid direct dict access unless calling `.raw()`.","message":"The SDK uses `snake_case` for Python, but the Glean API spec uses `camelCase`. Models auto-convert, but raw response dicts from `resp.raw()` return camelCase fields.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install: pip install glean-api-client. Import: from glean_api_client import Glean","cause":"Package name in PyPI is `glean-api-client`, but import uses underscores.","error":"ModuleNotFoundError: No module named 'glean_api_client'"},{"fix":"Set valid token: `Glean(access_token=os.environ.get('GLEAN_ACCESS_TOKEN'))`","cause":"The access_token keyword argument not provided or empty string.","error":"glean_api_client.errors.ServerValidationError: 'access_token' is a required property"},{"fix":"Use keyword arguments: `Glean(access_token='...', server_url='...')`","cause":"Using positional argument instead of keyword argument for old API.","error":"TypeError: Glean.__init__() missing 1 required positional argument: 'security'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}