Integrate Gloo AI into your applications using the official OpenAI libraries.
Gloo AI is designed to be drop-in compatible with the OpenAI API format. This means you can use the official, community-maintained OpenAI SDKs for Python and Node.js to build values-aligned applications without learning a new syntax.
Compatibility Mode
You do not need to install a specific “Gloo” library. You simply configure the standard OpenAI client to point to Gloo AI’s infrastructure.
Before using the SDK, you need to obtain an access token using your Client ID and Client Secret. Gloo AI uses OAuth2 client credentials flow—there are no long-lived API keys.
1
Get your credentials
Obtain your Client ID and Client Secret from the API Credentials page in Gloo AI Studio.
2
Exchange for access token
Use your credentials to get a temporary bearer token (expires in 1 hour).
3
Use token in SDK
Pass the access token as the api_key parameter in the OpenAI client.
Access tokens expire after 1 hour. Your application must handle token refresh. See the Authentication Tutorial for complete token management patterns.
Because Gloo AI adheres to open standards, you can use it directly inside AI-native code editors (like Cursor, Windsurf, or VS Code) to “vibe code” with values-aligned models.
Cursor / VS Code
Go to Settings > Models
Add a Custom Provider
Set URL: https://platform.ai.gloo.com/ai/v1
Generate an access token and paste it as the API key
Agent Frameworks
Compatible with LangChain, CrewAI, and AutoGen by setting the openai_api_base parameter and providing an access token.
Access tokens expire after 1 hour. For editor integrations, you’ll need to generate a new token periodically via the API Credentials page or programmatically using the OAuth2 flow.