API overview
The Kibotos API lets your own programs create and use Workspaces and operate the deployment without going through kibo. This page introduces the packages, the two endpoints and their protocol, shows a first request, and points to the page that explains each service.
Overview
The API is a set of protobuf services that any language with a Connect, gRPC, or gRPC-Web client can call. Choose it over kibo when a program needs the full feature set or a compatibility commitment: the flags and output of kibo are outside that commitment.
| You are writing | Use |
|---|---|
| Manual operations, shell scripts, troubleshooting | The kibo CLI |
| A program in any language that needs the full feature set and compatibility commitments | The API, as described in this section |
| A Go program | The Go SDK, which carries the generated code and handles certificates and data-plane credentials for you |
| A program already written against the E2B SDK | E2B compatibility |
The pages in this section cover:
- Authentication: obtaining an Operator identity and the TLS settings for both endpoints.
- Write operations and errors: capabilities, command IDs, expected revisions, and the error format.
- Data plane: session credentials and calling the node that runs a Workspace.
For Workspaces, generations, Volumes, and their states, see Core concepts. For when data is kept, see Guarantees and limits.
A first request
This request queries the server's capabilities with curl and an existing kibo context identity. It also confirms that the certificates and the address are correct:
ctx="${KIBO_CONTEXT_DIR:-$HOME/.config/kibo/context}"
cert=$(ls "$ctx"/identity-*.pem)
curl --http2 --tlsv1.3 \
--cert "$cert" --key "${cert%.pem}.key" --cacert "$ctx/server-ca.pem" \
-H 'Content-Type: application/json' --data '{}' \
https://ctrl.example.com:18092/kibotos.ctrl.v1.ServerInfoService/GetServerInfoThe response contains the source revision the server was built from and its list of capability names. A program of your own uses an identity of its own; see Authentication. Go programs build this client from the identity with the Go SDK.
Packages and endpoints
Proto packages
The interface definitions are under proto/ in the Kibotos repository:
| proto package | File | Contents |
|---|---|---|
kibotos.ctrl.v1 | ctrl.proto | Workspace API, plus the file, process, desktop, and service connection interfaces that run on the node |
kibotos.operator.v1 | operator.proto | Operator API: publishing, approval, node management, enrollment keys |
kibotos.enrollment.v1 | enrollment.proto | Exchanging an enrollment key for an identity, renewal |
kibotos.service.v1 | service.proto | Target and message types for service connections |
Every service, method, message, and enum of these packages is listed in the API reference, generated from the proto files and their comments.
The first three packages and the kibotos.service.v1 types used on the data plane carry a compatibility commitment. See Compatibility commitments.
Two endpoints
Files, processes, the desktop, and service connections of a Workspace go directly to the node that runs it. Everything else goes to ctrl:
mTLS (Operator identity) Bearer (session credential)
Third-party ──────────────────────────► ctrl ───────────────────────► node data plane
program Workspace API / Operator API / enrollment files / processes / desktop / service connections / /v1/files| Endpoint | Address | Authentication | Details |
|---|---|---|---|
| ctrl (control plane) | [api].listen in the ctrl configuration, such as https://ctrl.example.com:18092 | mTLS; the client certificate is the Operator identity obtained at enrollment | Authentication |
| node (data plane) | session.endpoint in the CreateDataPlaneSession response | HTTP header Authorization: Bearer <credential> | Data plane |
Protocol
Both endpoints use the Connect protocol, HTTP/2 over TLS 1.3.
- Request format:
POST https://<host>/<package>.<Service>/<Method>. - The
Content-Typeof a unary call can beapplication/protoorapplication/json. Streaming calls useapplication/connect+protoorapplication/connect+json. - The server is implemented with connect-go and also accepts gRPC and gRPC-Web. The examples in these pages use the Connect protocol.
- No extra request headers are needed. There is no API version header and no User-Agent requirement. Client and server compatibility is determined through the capability list. See Write operations and errors.
- The size of each request message is limited by ctrl, measured after decompression in the encoding used: 16 MiB for
ArtifactPublicationService, 64 KiB forEnrollmentService, and 4 MiB for other services. Larger messages returnresource_exhausted. These limits are higher than the largest request each service accepts. - Streaming methods on the node data plane need HTTP/2. A single message of a service connection (
ServiceConnectionService.Connect) is at most 32 KiB.
Service map
Each service name links to its generated reference page, which lists its methods, messages, and enums. The topic page explains what the service does, its preconditions, and its results. On the Workspace topic pages, the API details are in the section "With the API", after the kibo usage.
Workspace API (kibotos.ctrl.v1)
These services run on ctrl.
| Service | Purpose | Explained in |
|---|---|---|
ServerInfoService | Source revision and capability list | Write operations and errors, Capability names |
TemplateService | Read-only Template catalog | Listing Templates |
WorkspaceService | Workspace lifecycle and configuration | Creating and listing, Lifecycle, Resources and health, Expiration, Network policy, Labels and annotations |
VolumeService | Volumes | Volumes, export, and restore |
TransferService | Export and restore | Export, import, and restore |
WorkspaceObservationService | Cleanup results after deletion | Checking cleanup status |
WorkspaceMetricsService | Host and guest resource readings over time | Reading resource metrics |
DataPlaneSessionService | Obtain a data-plane session credential | Data plane |
ExposureService | Publish a port inside a Workspace as a public HTTP preview | Public URLs |
EgressService | SOCKS5 exits that callers bring themselves | Egress |
ResolverService | DNS upstreams that callers choose | Resolver |
Data-plane services
These services are defined in ctrl.proto but run on the node data plane, not on ctrl. Call them with a session credential at the session's endpoint, which also serves two HTTP endpoints.
| Service or endpoint | Purpose | Explained in |
|---|---|---|
FilesystemService | Directory and metadata operations, and watching directories | Files |
/v1/files | Transferring the content of one file | Files |
ProcessService | Commands and terminals | Commands and terminals |
DesktopService | Desktop capture and input | Desktop |
ServiceConnectionService | Byte streams to a port or socket in the guest | Services and ports |
/v1/service | The same connection over a WebSocket | Services and ports |
Operator API (kibotos.operator.v1)
These services run on ctrl.
| Service | Purpose | Explained in |
|---|---|---|
ArtifactPublicationService | Publish Templates and Platforms | Build and publish on a build host |
TemplateLifecycleService | Prewarm a Template on a given node | kibo template prepare |
TemplateCatalogService | Template approval and default revision | Template admission |
PlatformCatalogService | Platform approval and default revision | Catalog |
NodeRegistrationService | Node state, drain, isolation, retirement, storage pools and the objects in them, declaring a pool lost, moving objects between pools, Workspace placements, creating and starting on a given node, and overcommit ratios | Nodes, Storage pools |
ArtifactRetentionService | Reclaim artifacts no longer in use, and retain a given Launch | Artifact reclamation |
EnrollmentGrantService | Issue and revoke enrollment keys | Issuing and revoking enrollment keys |
Enrollment (kibotos.enrollment.v1)
| Service | Purpose | Explained in |
|---|---|---|
EnrollmentService | Exchange an enrollment key for an identity, and renew it. Served on the ctrl endpoint | Authentication |
Next steps
- Authentication: obtain an identity for your program.
- Write operations and errors: the rules every write operation follows.
- Data plane: reach the files, processes, and services of a Workspace.
- The conformance suite under
conformance/accesses a deployed environment only through these public interfaces, and can serve as a reference implementation of how to call them.
kibo CLI
With the kibo command line, you create Workspaces, work inside them, and script both. This page covers the commands you use most, how kibo waits for results, and how to repeat a command safely. Every flag of every command is listed under kibo commands.
Authentication
Requests to ctrl authenticate with an Operator identity over mTLS, and requests to the node data plane carry a short-lived session credential. This page shows how a program obtains an Operator identity, how to configure TLS for both endpoints, and how to keep the identity renewed.