Skip to content
Home

SDK Quickstart

Confirm the local runtime first: TypeScript SDK requires Node.js 18.17+, and Python SDK requires Python 3.10+. After installation, import the Python package as seacloud_sdk.

Terminal window
pnpm add @seacloudai/sdk

The caller must pass the API key explicitly. Your application may read it from an environment variable first, but the SDK does not do that automatically.

import { SeaCloud, getSeaCloudDocs } from "@seacloudai/sdk";
const docs = getSeaCloudDocs();
const client = new SeaCloud({
apiKey: process.env.SEACLOUD_API_KEY!,
timeout: 600_000,
});
console.table(docs.methods);
const text = await client.chat.send(
"gpt-4.1",
[{ role: "user", content: "Introduce SeaCloud SDK in one sentence." }],
{ temperature: 0.2, maxTokens: 128 },
);
console.log(text);

run creates a task and returns immediately. runSync and run_sync create a task, poll status, read the final response, and return a normalized result.

const result = await client.runSync("wan25_t2i_preview", {
prompt: "a cinematic photo of a cat astronaut",
n: 1,
prompt_extend: true,
size: "1024*1024",
watermark: false,
});
console.log(result.output?.urls);
  • For dryRun, polling, model specs, and errors, continue to the operation manual.