Skip to main content

Environment Setup

First, you’ll need these environment variables:
Your agent’s unique identifier (found in Agents tab)
export BLOOM_AGENT_ID="your-agent-id"
Your organization’s API key (found in Profile tab)
export BLOOM_ORG_API_KEY="your-org-key"
Combined auth string for MCP servers
export BLOOM_AUTH="bloom_{ORG_KEY}_agent_{AGENT_ID}"

Integration Methods

Choose your preferred integration method:

Direct API Integration

Use Bloom’s proxy API directly in your Python code

MCP Server Integration

Use the bloom-mcp-wrapper with any stdio MCP server

Test Your Setup

Once configured, test your integration:
import requests
import os

def test_bloom_connection():
    response = requests.post(
        "https://iam.bloomtechnologies.app/https://api.openai.com/v1/chat/completions",
        headers={"Authorization": f"Bearer {os.getenv('BLOOM_ORG_API_KEY')}"},
        json={
            "agent_id": os.getenv("BLOOM_AGENT_ID"),
            "messages": [{"role": "user", "content": "Hello, World!"}],
            "model": "gpt-3.5-turbo",
            "max_tokens": 50
        }
    )
    return response.json()

result = test_bloom_connection()
print(result)
Make sure your agent has the appropriate OpenAI scopes configured before testing.