Skip to main content

Prerequisites

Before creating your first agent, ensure you have:
  • Admin access to your Bloom organization
  • API credentials for the services you want to integrate
  • Basic understanding of HTTP APIs

Step 1: Create an Integration

1

Navigate to Integrations

Go to the Integrations tab in your Bloom dashboard
2

Add Service

Click “Add Integration” and select your desired service (e.g., OpenAI, GitHub, Serper)
3

Configure Credentials

Enter your API key and any required configuration for the service
Store your API keys securely. Bloom encrypts them but ensure they have appropriate permissions.
4

Test Connection

Use the test button to verify your integration is working correctly

Step 2: Define Scopes

Scopes control what your agent can access. Create granular permissions:
1

Go to Scopes Tab

Navigate to the Scopes section in your dashboard
2

Create New Scope

Click “Create Scope” and give it a descriptive name
3

Configure Permissions

Set up the allowed HTTP methods and API paths:
{
  "service": "openai",
  "methods": ["POST"],
  "paths": ["/chat/completions", "/embeddings"]
}
4

Save Scope

Review and save your scope configuration

Step 3: Create Your Agent

1

Navigate to Agents

Go to the Agents tab in your dashboard
2

Add New Agent

Click “Create Agent” and provide:
  • Name: Descriptive name for your agent
  • Description: What this agent does
3

Assign Scopes

Select the scopes you created in Step 2
You can assign multiple scopes to give your agent access to different services
4

Generate Agent ID

Copy your agent ID - you’ll need this for implementation

Step 4: Implement in Code

Choose your integration method:
import requests
import os

AGENT_ID = os.getenv("BLOOM_AGENT_ID")
ORG_API_KEY = os.getenv("BLOOM_ORG_API_KEY")

def call_openai(prompt):
    response = requests.post(
        "https://iam.bloomtechnologies.app/https://api.openai.com/v1/chat/completions",
        headers={"Authorization": f"Bearer {ORG_API_KEY}"},
        json={
            "agent_id": AGENT_ID,
            "model": "gpt-3.5-turbo",
            "messages": [{"role": "user", "content": prompt}],
            "max_tokens": 150
        }
    )
    return response.json()

# Test your agent
result = call_openai("Hello from my Bloom agent!")
print(result)

Verification

Test that everything is working:
  1. Check Agent Status: Verify your agent appears in the dashboard
  2. Test API Call: Make a simple request through the proxy
  3. Review Logs: Check the activity logs in your dashboard
  4. Validate Scopes: Ensure your agent can only access permitted endpoints
If you encounter authentication errors, double-check your environment variables and scope assignments.

Common Issues

Your agent likely doesn’t have the required scopes. Check:
  • Agent has the correct scopes assigned
  • Scope includes the HTTP method you’re using
  • Scope includes the exact API path
Verify:
  • BLOOM_AGENT_ID environment variable is set correctly
  • Agent ID exists in your dashboard
  • Agent hasn’t been deleted or deactivated
Ensure:
  • Integration exists and is properly configured
  • Service name in URL matches integration name
  • API credentials are valid and have necessary permissions

Next Steps