Skip to main content

Overview

The Instances API provides information about running OpenCode instances managed by the Portal.

List Instances

Retrieve all running OpenCode instances.

Authentication

No authentication required.

Response

number
Total number of running instances
array
Array of instance objects

Example

Response

Instance Types

Process Instances

Instances running as native OS processes:
  • instanceType: "process"
  • opencodePid: Valid process ID
  • containerId: null

Docker Instances

Instances running in Docker containers:
  • instanceType: "docker"
  • opencodePid: null
  • containerId: Docker container ID

Use Cases

Dashboard Display

Display all running instances in a web interface:

Health Monitoring

Monitor instance health:

Instance Discovery

Find instances by directory or name:

Notes

Only running instances are returned. Stopped instances are automatically filtered out.
The instance list is read from ~/.portal.json and filtered to show only currently running processes or containers.
Process IDs (opencodePid, webPid) are platform-specific and should not be used for long-term reference. Use the id field for persistent identification.
Use the port field to construct API URLs for instance-specific endpoints:

Additional Endpoints

Get Project Information

Retrieve current project information for an instance:

Path Parameters

number
required
The OpenCode instance port number

Response

string
Project name
string
Absolute path to project directory
string
Git repository URL if available

Example

Response

Health Check

Check if an OpenCode instance is healthy:

Path Parameters

number
required
The OpenCode instance port number

Response

boolean
Whether the instance is healthy and responding
number
The instance port number

Example

Response

Get Configuration

Retrieve OpenCode configuration for an instance:

Path Parameters

number
required
The OpenCode instance port number

Example


Get Providers

Retrieve available AI providers for an instance:

Path Parameters

number
required
The OpenCode instance port number

Response

array
Array of available AI provider configurations

Example

Response

Get Agents

Retrieve available agents for an instance:

Path Parameters

number
required
The OpenCode instance port number

Response

array
Array of available agent configurations

Example


System Endpoints

Get System Hostname

Retrieve the system hostname where Portal is running:

Authentication

No authentication required.

Response

string
The system hostname

Example

Response

Use Cases

This endpoint is useful for:
  • Displaying the server name in the UI
  • Identifying which server you’re connected to when managing multiple instances
  • Debugging connection issues in remote setups