Skip to content

Self-Hosted Deployments

If you're running CloMan on your own infrastructure, override the default base URL when creating a client.

Configuration

from cloman import CloMan

client = CloMan(
    api_key="cloman_...",
    base_url="https://cloman.your-company.com",
)

result = client.decide(context="Should we approve?")
import { CloMan } from "@clomanai/sdk";

const client = new CloMan("cloman_...", {
  baseUrl: "https://cloman.your-company.com",
});

const result = await client.decide({ context: "Should we approve?" });
curl -X POST https://cloman.your-company.com/api/v1/public/decide \
  -H "X-API-Key: $CLOMAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"context": "Should we approve?"}'

Base URL Format

The base_url / baseUrl should be the root URL of your CloMan instance without a trailing slash or path:

https://cloman.your-company.com       ✅ correct
https://cloman.your-company.com/      ✅ (trailing slash is stripped)
https://cloman.your-company.com/api   ❌ don't include /api

The SDK appends /api/v1/public/decide automatically.

Environment Variable Pattern

Use an environment variable to switch between hosted and self-hosted:

import os
from cloman import CloMan

client = CloMan(
    api_key=os.environ["CLOMAN_API_KEY"],
    base_url=os.environ.get("CLOMAN_BASE_URL", "https://api.cloman.app"),
)
import { CloMan } from "@clomanai/sdk";

const client = new CloMan(process.env.CLOMAN_API_KEY!, {
  baseUrl: process.env.CLOMAN_BASE_URL ?? "https://api.cloman.app",
});

Network Considerations

  • Ensure your instance is accessible from the client's network.
  • If using HTTPS (recommended), the SSL certificate must be valid or trusted by the client.
  • Timeouts may need adjustment if your self-hosted instance has different latency characteristics.