SDKs

Typed clients for TypeScript and Python that handle the base URL and bearer token for you.
View as Markdown

CloudRaker ships typed SDKs for TypeScript and Python: @cloudraker/api on npm and cloudraker on PyPI. Both wrap the same API. They set the Authorization header from a token you provide and default to the Production base URL. Method names map to the API reference.

The SDKs target https://api.cloudraker.com out of the box. There is no base URL to configure.

As of 0.3.0 both SDKs cover the whole /v1 surface, alongside the rest of the API. This includes the six capability verbs, batch extraction, the run lifecycle including GET /v1/runs, files, templates, actions, and webhooks.

The six verbs are top-level methods on the client, not a namespace: extract, extractBatch, parse, redact, fill, sign, pipeline (snake_case in Python: extract_batch).

TypeScript — @cloudraker/api

Uses native fetch. Ships precompiled CJS + ESM, so no build step is necessary.

Install

$npm install @cloudraker/api

Use

1import { CloudRakerClient, CloudRakerEnvironment } from "@cloudraker/api";
2
3const client = new CloudRakerClient({
4 environment: CloudRakerEnvironment.Production, // the default — you can omit this
5 token: process.env.CLOUDRAKER_API_KEY!, // string, or a () => string supplier
6});
7
8// health check (no auth required)
9await client.health();
10
11// current identity
12const me = await client.me.getMe();
13
14// list spaces
15const spaces = await client.spaces.listSpaces();

Extract, end to end

1import { CloudRakerClient } from "@cloudraker/api";
2
3const client = new CloudRakerClient({ token: process.env.CLOUDRAKER_API_KEY! });
4
5const run = await client.extract({
6 file: { url: "https://www.irs.gov/pub/irs-pdf/fw9.pdf", name: "w9.pdf" },
7 citations: true, // off by default; ask for the evidence
8 schema: {
9 type: "object",
10 properties: {
11 business_name: { type: ["string", "null"] },
12 tax_classification: { type: ["string", "null"] },
13 },
14 },
15});
16
17if (run.status === "processed") {
18 console.log(run.output?.value); // the extracted object
19 console.log(run.output?.citations); // JSON path -> fileId + page + bbox; absent unless citations were asked for
20} else {
21 // still running past the wait window — poll by id
22 const latest = await client.runs.getRun({ id: run.id });
23 console.log(latest.status);
24}

The call holds open until the run finishes, up to wait seconds (default 60, max 120, 0 returns immediately). See runs for the polling and webhook paths.

Resource namespaces on the client: actions, authorization, dataObjects, files, home, installedActions, me, ontology, organizationSettings, organizationTemplates, playbooks, process, runs, search, spaceFiles, spaceRuns, spaces, templates, webhooks — plus the top-level health(), extract(), extractBatch(), parse(), redact(), fill(), sign() and pipeline(). The full per-endpoint method list lives in the SDK’s dist/reference.md.

Python — cloudraker

Sync and async clients, built on httpx + pydantic. Requires Python 3.9+.

Install

$pip install cloudraker

Use (sync)

1import os
2from cloudraker.client import CloudRaker
3from cloudraker.environment import CloudRakerEnvironment
4
5client = CloudRaker(
6 environment=CloudRakerEnvironment.PRODUCTION, # the default — you can omit this
7 token=os.environ["CLOUDRAKER_API_KEY"], # str, or a Callable[[], str] supplier
8)
9
10client.health()
11me = client.me.get_me()
12spaces = client.spaces.list_spaces()

Extract, end to end

1import os
2from cloudraker.client import CloudRaker
3
4client = CloudRaker(token=os.environ["CLOUDRAKER_API_KEY"])
5
6run = client.extract(
7 file={"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "name": "w9.pdf"},
8 citations=True, # off by default; ask for the evidence
9 schema={
10 "type": "object",
11 "properties": {
12 "business_name": {"type": ["string", "null"]},
13 "tax_classification": {"type": ["string", "null"]},
14 },
15 },
16)
17
18if run.status == "processed":
19 print(run.output.value) # the extracted object
20 print(run.output.citations) # JSON path -> fileId + page + bbox; absent unless citations were asked for
21else:
22 # still running past the wait window — poll by id
23 print(client.runs.get_run(id=run.id).status)

The call holds open until the run finishes, up to wait seconds (default 60, max 120, 0 returns immediately). See runs for the polling and webhook paths.

Async

1from cloudraker.client import AsyncCloudRaker # same signature, awaitable methods
2
3client = AsyncCloudRaker(
4 environment=CloudRakerEnvironment.PRODUCTION,
5 token=os.environ["RAKERONE_API_KEY"],
6)
7me = await client.me.get_me()

The constructor also accepts base_url, headers, timeout (default 60s), max_retries (default 2), follow_redirects (default True), and httpx_client. Resource namespaces mirror the TypeScript client (snake_case): actions, authorization, data_objects, files, home, installed_actions, me, ontology, organization_settings, organization_templates, playbooks, process, runs, search, space_files, space_runs, spaces, templates, webhooks — plus the top-level health(), extract(), extract_batch(), parse(), redact(), fill(), sign() and pipeline(). The full method list is in the SDK’s src/cloudraker/reference.md.

Authentication

The token you pass is an organization API key or a session JWT. Both go in the Authorization: Bearer header, which the SDK sets for you. Pass a () => string supplier to rotate the token without rebuilding the client.

Where to go next