API Clients
Glean offers official API clients for several popular programming languages to help developers integrate Glean's powerful search and knowledge capabilities into their applications. These clients provide language-specific interfaces to Glean's APIs, making it easier to build custom solutions without having to handle the low-level HTTP requests.
Authentication Required: For per-user Client API features such as search and chat, prefer an OAuth access token; the SDKs accept it through the same credential field as a Glean-issued token. Use Client API authentication to choose the access model. Indexing API document-management operations require Glean-issued tokens.
Unified Libraries: These API clients support both Client API and Indexing API functionality. Use the same library with different tokens depending on whether you're building user-facing features (Client API) or managing document indexing (Indexing API).
Choose Your Language
Select your preferred programming language to get started with the official Glean API client:
Python
Full-featured Python client with framework integrations for FastAPI, Django, and Streamlit
TypeScript
Type-safe client for Node.js and browser applications with React, Next.js, and Express examples
Go
Idiomatic Go client with concurrency patterns and framework integrations for Gin and Echo
Java
Enterprise-ready Java client with Spring Boot integration and reactive programming support
What's Included
All official API clients provide:
Client API Features
- Chat API: Build conversational AI applications
- Search API: Integrate enterprise search capabilities
- Agents API: Execute pre-built agents from Agent Builder
- Collections API: Manage and search document collections
Indexing API Features
- Document Management: Index, update, and delete documents
- User Management: Manage users, groups, and permissions
- Datasource Configuration: Set up and configure data sources
- Bulk Operations: Efficient batch processing for large datasets
Developer Experience
- Type Safety: Full type definitions and IntelliSense support
- Error Handling: Structured error responses and retry mechanisms
- Framework Integration: Examples for popular web frameworks
- Testing Support: Mock examples and integration test patterns
- Documentation: Comprehensive guides with real-world examples
Production Ready
- Rate Limiting: Automatic handling with exponential backoff
- Timeout Control: Configurable request timeouts
- Connection Pooling: Efficient HTTP connection management
- Security: Best practices for token management
Getting Started
- Choose your language from the cards above
- Follow the installation instructions for your package manager
- Get your credentials:
- Client API authentication for search and chat features; OAuth is preferred for per-user integrations
- Indexing API Glean-issued tokens for document management
- Start building with the provided examples
Alternative Integration Options
If you prefer not to use an API client library:
Direct HTTP Requests
Use Glean's REST APIs directly with your preferred HTTP library
Web SDK
Frontend JavaScript components for search and chat interfaces