---
title: "Use the SDK"
description: "Call the same operations from your own application."
---

> Documentation Index
> Fetch the complete documentation index at: https://podstead.wking.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the SDK

The SDK uses Effect for typed results, errors, cancellation, and injected transports. It shares operation contracts with the HTTP API, CLI, and MCP server.

Build the source packages first. They are not published to npm yet. Consumers need `effect@4.1.6` alongside `@r2cast/sdk`.

```ts
import { Effect } from "effect";
import { createClient } from "@r2cast/sdk";

const client = createClient({
  url: "https://YOUR_MANAGEMENT_HOST",
  headers: authorizedHeaders,
});

const shows = await Effect.runPromise(client.call("list_podcasts", {}));
```

`authorizedHeaders` comes from your server-side session or scoped credential. It is not a secret to hard-code or send to a browser bundle.

## Errors and retries

Validation failures, missing permission, revision conflicts, and transport errors stay distinct. Do not blindly retry a mutation with a fresh key after a timeout. Reuse its original idempotency key and read the resulting state.

Uploads use a bounded binary transport and support interruption. JSON operations return asset metadata, not media contents.

## Other transports

Provide the exported `Transport` service for a different transport. The default HTTP transport calls the same canonical operations as MCP. Task views use a same-origin session or the host's MCP Apps bridge.

See [operations](https://podstead.wking.dev/docs/reference/operations/) for available calls, and the package's exported input/output schemas for the exact types.

Source: https://podstead.wking.dev/docs/agents/sdk/index.mdx
