Skip to main content
Available on the Enterprise plan. Contact sales to learn more.
SDK versions 1.x introduce a new API that is not compatible with versions 0.x. The package names remain the same, so update your code when upgrading from a 0.x version to a 1.x version. Follow Migrate from SDK versions 0.x for language-specific instructions.
Use the Ona SDK to create and manage environments, run commands, access files, and start Codex agents from Python, TypeScript, or Go.

Install an SDK

Install the gitpod-sdk package:
Import the high-level SDK from ona_sdk. Python 3.10 or later is required.

Authenticate the SDK

Create a personal access token, then set ONA_API_KEY:
The SDK reads ONA_API_KEY when you use create_client_from_env, createClientFromEnv, or sdk.NewFromEnv. The default API URL is https://app.ona.com/api. If your organization uses a custom management-plane domain, also set:
Python applications can use create_client(api_key=..., base_url=...), and TypeScript applications can use createClient({ apiKey, baseUrl }). Do not commit tokens to source control.

Create an environment and run a command

Each high-level client creates a running environment from a repository URL and returns an environment handle. The handle provides command, file, Git, and agent operations.

Choose high-level workflows or direct API clients

Use the high-level SDK for environment and Codex workflows. It handles tasks such as resolving repository context, selecting an environment class, waiting for state changes, connecting to environment operations, and mapping common failures to typed errors. Use the generated clients when the high-level SDK does not cover an API operation:
  • Python: protobuf messages are under gitpod.v1, and authenticated synchronous service clients are available from ona.services.
  • TypeScript: core service clients are available from ona.services. Generated protobuf schemas and service descriptors are exported from subpaths such as @gitpod/sdk/gitpod/v1/environment_pb.
  • Go: protobuf messages are in github.com/gitpod-io/gitpod-sdk-go/v1, and generated Connect clients are in github.com/gitpod-io/gitpod-sdk-go/v1/v1connect.
Direct API clients use protobuf request and response messages. See the API reference for the available services, methods, and fields. The API also covers organization reporting through the Ona Intelligence usage API and AI cost usage API.

Run the full examples

The published SDK packages include runnable examples for environment operations and Codex agents:

Troubleshooting

Set ONA_API_KEY in the process that starts your application. SDK versions 1.x prefer ONA_API_KEY; GITPOD_API_KEY is supported as a compatibility fallback.
Set ONA_BASE_URL to your custom management-plane origin followed by /api, for example https://ona.example.com/api. Do not use the vscode. subdomain.