Skip to main content
Your self-hosted instance serves the same REST API as OneCLI Cloud, so the CLI, SDKs, and agents work the same way. You just point them at your instance instead of api.onecli.sh. There are two ways to get an agent running: through the dashboard, or headless over the API. On the Enterprise image, the organization API key makes this fully headless from first boot; on Community, create a project API key in the dashboard first and use it the same way.

Headless: provision straight from the API

On the Enterprise image, the organization and its API key are created at container startup, so the API works before you ever open the dashboard. One call provisions everything an agent needs:
On the first call, the instance provisions a default project and a default agent, then returns the agent’s proxy configuration: proxy URLs carrying the agent’s access token, and the gateway’s CA certificate. Apply the env values and write caCertificate to the NODE_EXTRA_CA_CERTS path, and the agent’s HTTP traffic routes through your gateway.
The proxy URL’s host comes from GATEWAY_BASE_URL (default host.docker.internal:10255), which is right for agent containers on the same Docker host. If agents run elsewhere, set GATEWAY_BASE_URL to an address they can reach. See Configuration.

With the SDK

The Node SDK wraps the same endpoint. Point it at your instance and let it configure agent containers:

Managing the instance over the API

The organization API key works across the REST API. Project-scoped endpoints take an X-Project-Id header:

Organization-level connections and rules

Organization-level resources take no X-Project-Id at all: the organization comes from the key itself, and anything you create applies to every project and agent on the instance. Connect an API-key app organization-wide:
For OAuth apps, configure the app’s OAuth client first (see App credentials), then request the authorize URL and open it in a browser to finish the flow:
Organization policy rules work the same way and apply to every agent (see Policy rules for the draft → publish model):
Then enforce the draft with POST /v1/org/policy/publish. Inspect what exists with GET /v1/org/connections and GET /v1/org/policy/rules, or use the CLI: the onecli org apps connect, onecli org apps authorize, and onecli org policy commands wrap the same endpoints. Agents pick up new organization connections and published rules on their next request.
The /v1/org/policy surface is available on Enterprise releases running the policy engine. Self-hosted releases that predate it use the older /v1/org/rules API instead (onecli org rules --help).

Through the dashboard

Open your instance’s dashboard, connect the apps your agents need (see app integrations), and add LLM keys under Secrets. Agents provisioned through container-config pick up new connections and secrets on their next request; no restart needed.

Next steps