Server4Agent

SDKs

Server4Agent SDKs for Python, TypeScript, and Go

Official, typed clients for the Server4Agent REST API. Provision agent servers, run commands, manage files, ship builds to a live URL, and verify webhooks, from your backend, a CI job, or a script. The Python and TypeScript clients share the same methods and shapes; Go is generated from our OpenAPI spec.

Read the SDK docs

Install

Examples in
shell
npm install @server4agent/sdk

Zero to a live URL

~10 lines
quickstart.ts
import { Server4Agent } from "@server4agent/sdk";

const client = new Server4Agent(); // reads SERVER4AGENT_API_KEY

// Provision a server and hand the on-server agent a goal.
const server = await client.servers.create({ tier: "small" });
const build = await server.builds.start("a FastAPI todo API with a web UI");
await build.wait();

console.log("live at", build.url);

Capabilities

One typed client for the whole API

Every method maps 1:1 to a REST endpoint, so anything you can do over HTTP you can do with a type in front of it.

Provision and control servers

Create small, medium, or large servers, start and stop them, and tear them down when the work is done.

Run commands and manage files

exec any shell command and read, write, or list files in the durable workspace that persists between runs.

Run tasks and builds

Hand the on-server agent a goal, or start a structured build pipeline, and wait until it reaches a live URL.

Deploy to a live URL

Publish a project to a public *.apps.server4agent.com URL, toggle visibility, and clean up ephemeral projects.

Verify webhooks

A built-in helper checks the signature on every delivery, so you can trust the payload before you act on it.

Typed, retried, async-ready

Fully typed methods, automatic retries on 429 and 5xx, and a full async client in Python.

Do you even need the SDK?

If your agent decides on its own when to provision a server or run a command, point it at the MCP server instead; it already speaks tool-calling and needs no SDK. Reach for these clients for the code around your agent: the parts of your stack that call the API on a schedule, in response to a webhook, or from your own product logic.

Backends that provision workspaces per customer
CI jobs that spin up a preview URL per pull request
Webhook receivers that react to deploys and builds

FAQ

Server4Agent SDK questions

Does Server4Agent have a Python SDK?

Yes. Run pip install server4agent to install the official Python client. It is fully typed, works on Python 3.9 and newer, ships both a synchronous and an asynchronous client, and depends only on httpx.

Is there a JavaScript or TypeScript SDK?

Yes. Run npm install @server4agent/sdk to install the official JavaScript/TypeScript client. It is written in TypeScript, ships its own type definitions, runs on Node 18 and newer, and retries failed requests automatically.

Is there a Go SDK?

Yes. Run go get github.com/Server4Agent/server4agent-go to add the Go client. It is a typed client generated from the Server4Agent OpenAPI spec and covers the full REST API. Authenticate by passing your sk_live_ key as a bearer token through a context value.

What can the Server4Agent SDK do?

It wraps the Server4Agent REST API: provision and control servers, run shell commands, read and write files, start agent tasks and structured builds, deploy projects to a live URL, manage API keys, and verify webhook signatures.

Do I need the SDK to use Server4Agent with my AI assistant?

No. If your agent does its own tool-calling, connect it to the Server4Agent MCP server instead; it already speaks tool-calling. The SDKs are for the code around your agent: your backend, a CI job, a webhook receiver, or an admin script.

Are the Server4Agent SDKs free and open?

The clients are published to the public npm, PyPI, and Go module ecosystems and are free to install and use. You only pay for the Server4Agent compute you provision through them, metered against your account budget.

Does the Python SDK support async?

Yes. Alongside the synchronous client, Server4Agent ships AsyncServer4Agent, which mirrors the sync client method-for-method with awaitable calls.

How do the SDKs authenticate?

With a Server4Agent API key. The Python and JavaScript/TypeScript clients read the SERVER4AGENT_API_KEY environment variable by default, or you can pass the key explicitly when you construct the client. The Go client takes your sk_live_ key as a bearer token through a context value.

Install it and provision your first server

Grab an API key, install the client for your language, and go from zero to a live URL in a few lines.

SDK documentation