Skip to content

Management SDK

@open-compute/sdk is the capability-scoped TypeScript SDK for the open-compute management API. It exposes exactly the operations ocd has qualified against the pinned official Cloudflare OpenAPI snapshot, plus open-compute-only operations under client.openCompute. Every standard method delegates to the pinned official cloudflare SDK implementation, so authentication, retries, pagination, multipart uploads, and error parsing match the official client exactly.

Terminal window
npm install @open-compute/sdk

Pair the SDK X.Y.Z with the same ocd release version.

import { createOpenComputeClient } from "@open-compute/sdk";
const client = createOpenComputeClient({
apiToken: process.env.OPEN_COMPUTE_API_TOKEN!,
baseURL: "https://compute.example/client/v4",
});
await client.workers.scripts.versions.list("app", { account_id });
await client.d1.database.list({ account_id });
await client.openCompute.system.status();
  • apiToken and baseURL are required; the client never reads ambient credential environment variables.
  • baseURL must be an absolute URL whose canonical path ends in /client/v4; plain HTTP is only accepted for loopback test addresses.
  • defaultHeaders cannot override Authorization or platform-internal headers.
  • Construction never touches the network and never sends requests to api.cloudflare.com.

The exposed surface is generated from the repository OpenAPI authority and recorded in the committed surface report (packages/sdk/surface.json in the repository, mirrored into release.json for every release). Highlights:

  • Workers: scripts, versions, deployments, secrets, schedules, settings, script settings, tails, assets upload, subdomain.
  • Worker Script/Version upload uses one JSON metadata part plus named module parts and includes typed Service props, Artifacts bindings, and multi-step Durable Object migrations. Historical Version deletion uses the official Beta route.
  • KV, D1 (including time travel), R2 objects, Queues (including metrics and message push/bulk push), Workflows, Vectorize, AI Search, memberships, user, accounts.
  • Vendor operations under client.openCompute: capabilities, system status, scheduler pause/resume/repair, cache garbage collection, image capacity, upgrade check, worker endpoints, durable object inventory, KV and D1 backups.

Operations that ocd supports but the pinned official SDK does not implement are deliberately not exposed; the exclusion is recorded in the selection manifest. Deviations on supported operations are listed in Behavior differences.

Failures throw the official SDK error classes (APIError and its subclasses), re-exported from the package.

Browser Run public routes and fixed browser clients do not imply generated management methods. The current facade does not expose Browser management methods; see Browser Run for configuration, the public route subset and limits.

The fixed official cloudflare@7.2.0 SDK has no methods for the Container management routes used by cf. The generated facade therefore has no Container management methods. packages/sdk/surface.json records these exclusions. The management capability inventory lists the implemented routes separately from the 65-member tenant runtime API. Use the pinned project-local cf workflow described in Containers; a supported runtime member does not imply a generated SDK method.