Skip to main content
Get started with Gloo AI Studio. This walks you through what to expect when you create an account as well as how you can make your first API call.

Step 1: Create Your Account & Organization

Start by creating your account at Gloo AI Studio. Once your email is verified, the onboarding wizard will guide you through setting up your organization:
  1. Create your Organization: Give your team a name to manage projects and collaboration.
  2. Invite your Team: (Optional) Add email addresses to invite collaborators immediately, or skip this step.

Step 2: Set Up Billing & Spend Limits

To enable API access, you must set up a Pay-As-You-Go plan.
  • Add a Payment Method: Enter your credit card details to enable API usage. You are only charged for what you use.
  • Set a Spend Limit: You can define a weekly spending limit (e.g., $50/week) to control costs. If you don’t set a limit, you’ll be capped at $100/week which is also the maximum you can spend in a week for the Pay-As-You-Go plan.
If you skip billing: You can select “I’ll do this later”, but your account will be restricted to the Studio Playground (web interface only). You will not be able to make API calls until a payment method is added.
Want more details? See our comprehensive guides:
If you skipped the payment setup step you will land in Studio Playground where you can use a chat interface to the Completions API. If you added a payment method, you will be able to generate API credentials and make your first API call.

Step 3: Create Your API Credentials

The Gloo AI APIs use OAuth2 client credentials flow for authentication. To make an API call, you:
  1. Get API Credentials (Client ID and Client Secret) from Gloo AI Studio
  2. Use those credentials to get a short-lived access token
  3. Use the access token to authenticate your API calls
  4. Repeat step (2) whenever the access token expires
Here’s how to get your API credentials:
  1. Navigate to API Credentials in the Studio Dashboard.
  2. Copy the Client ID and Client Secret values if there are existing credentials, otherwise go to the next step.
  3. Click Create New Key to generate a Client ID and Client Secret.
Prefer using an SDK? Now that you have credentials, you can use the OpenAI Python or Node.js libraries with Gloo AI Studio. See Libraries & SDKs for a streamlined approach that handles token exchange for you.

Step 4: Generate an Access Token

Once you have a Client ID and Client Secret, you can generate an access token using one of the following methods:
import base64
import requests

def get_access_token(client_id: str, client_secret: str) -> dict:
    auth = base64.b64encode(f"{client_id}:{client_secret}".encode()).decode()

    response = requests.post(
        "https://platform.ai.gloo.com/oauth2/token",
        headers={
            "Content-Type": "application/x-www-form-urlencoded",
            "Authorization": f"Basic {auth}"
        },
        data={
            "grant_type": "client_credentials",
            "scope": "api/access"
        }
    )

    return response.json()

# Check token expiration
from jwt import decode
token_data = get_access_token(client_id, client_secret)
decoded = decode(token_data["access_token"], verify=False)
expiration = decoded["exp"]
The response will include an access token that you can use to authenticate your API calls. It should look like this:
{
  "access_token":"eyJraWQiOiJ...jwvh2t..cumG9g",
  "expires_in":3600,
  "token_type":"Bearer"
}
Access tokens expire after one hour. Monitor the token’s expiration by checking the ‘exp’ claim in the JWT payload. Since refresh tokens are not provided with client credentials, you will need to request a new access token when the current one expires.

Step 5: Make An API Call

Using the get_access_token function from Step 4, make a call to the Completions API.
# Uses get_access_token() from Step 4
token = get_access_token(client_id, client_secret)["access_token"]

response = requests.post(
    "https://platform.ai.gloo.com/ai/v2/chat/completions",
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {token}"
    },
    json={
        "model": "gloo-openai-gpt-5-mini",
        "messages": [
            {"role": "system", "content": "You are a human-flourishing assistant."},
            {"role": "user", "content": "How do I discover my purpose?"}
        ]
    }
)

print(response.json()["choices"][0]["message"]["content"])
The response should look like this:
{
    "id": "gen-1768500882-56HaBYeuAb4pLpv8PXqh",
    "object": "chat.completion",
    "created": 1768500882,
    "model": "gloo-openai-gpt-5-mini",
    "provider": "Gloo AI",
    "model_family": "OpenAI",
    "routing_mechanism": "direct_model_selection",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "message": {
                "content": "What a profound and meaningful question! ...",
                "role": "assistant"
            }
        }
    ],
    "usage": {
        "completion_tokens": 459,
        "prompt_tokens": 1115,
        "total_tokens": 1574
    }
}

Next Steps