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. Published rules apply to every agent on its next request. An organization connection joins every project’s credential pool, but an agent can use it only once you grant it:
The /v1/org/policy surface is available on Enterprise releases running the policy engine. Only self-hosted releases that predate it still use the older /v1/org/rules API — on any updated release it returns 410 Gone.

Through the dashboard

Open your instance’s dashboard, connect the apps your agents need (see app integrations), and add LLM keys under Secrets. After connecting, grant the new credential to the agents that should use it — the post-connect Agent access dialog does this in the same motion (see Agent access). Granted agents pick the change up on their next request; no restart needed.

Next steps