The @beeos-ai/sdk package is an auto-generated TypeScript client for the
BeeOS Platform API. It targets the
openapi-gateway exclusively and uses the
browser-native Fetch API with no external HTTP dependencies.
Installation
npm install @beeos-ai/sdk
Configuration
import { Configuration, DeployApi, InstancesApi, A2AApi } from "@beeos-ai/sdk";
const config = new Configuration({
basePath: "https://openapi.beeos.ai",
headers: {
Authorization: "Bearer oag_YOUR_KEY",
},
});
const deployApi = new DeployApi(config);
const instancesApi = new InstancesApi(config);
const a2aApi = new A2AApi(config);
For local development, set basePath to http://localhost:8095.
Catalog
List providers
const providers = await deployApi.listProviders();
console.log(providers.data);
// [{ meta: { id: "default", name: "BeeOS Cloud", ... }, capabilities: { ... } }]
List regions
const regions = await deployApi.listDeployRegions({ providerId: "default" });
console.log(regions.data);
// [{ id: "us-east-1", name: "US East", available: true }]
List deploy models
const models = await deployApi.listDeployModels({ agentFramework: "beeos-claw" });
console.log(models.data);
// [{ id: "gpt-4o", name: "GPT-4o", tier: "premium", reasoning: false }]
Instances
Deploy an instance
const instance = await instancesApi.deployInstance({
deployInstanceRequest: {
name: "my-agent",
agentFramework: "beeos-claw",
modelPrimary: "gpt-4o",
},
});
console.log(instance.data.id, instance.data.status);
List instances
const list = await instancesApi.listInstances({
page: 0,
pageSize: 20,
status: "running",
});
for (const inst of list.data) {
console.log(inst.id, inst.name, inst.status);
}
Get instance
const inst = await instancesApi.getInstance({ id: "inst_abc123" });
console.log(inst.data);
Lifecycle operations
await instancesApi.startInstance({ id: "inst_abc123" });
await instancesApi.stopInstance({ id: "inst_abc123" });
await instancesApi.restartInstance({ id: "inst_abc123" });
await instancesApi.destroyInstance({ id: "inst_abc123" });
A2A (user proxy)
Send a JSON-RPC message to an agent you own:
const result = await a2aApi.a2aJsonRpcForUser({
agentId: "agent_abc123",
a2AJSONRPCRequest: {
jsonrpc: "2.0",
id: 1,
method: "SendMessage",
params: {
message: {
role: "user",
parts: [{ kind: "text", text: "Hello!" }],
},
},
},
});
console.log(result.result);
Error handling
The SDK throws on non-2xx responses. Wrap calls in try/catch:
try {
await instancesApi.getInstance({ id: "nonexistent" });
} catch (error) {
if (error instanceof Response) {
const body = await error.json();
console.error("API error:", body);
}
}
TypeScript types
All request/response types are exported:
import type {
InstanceDataDTO,
DeployInstanceRequest,
ProviderCatalogItem,
A2AJSONRPCRequest,
A2AJSONRPCResponse,
} from "@beeos-ai/sdk";
Source and generation
The SDK is auto-generated from
beeos-platform-v1.yaml
using OpenAPI Generator (typescript-fetch). The published package mirrors
the generated output from the monorepo.