Skip to content
GigAI Tools

Developer API / docs

SDKs

Both clients have zero dependencies and wrap the whole import, run, export, download loop in one call. Source is public on GitHub.

Install

python

pip install gigai-tools

node

npm install gigai-tools

Set your key once as GIGAI_API_KEY. Both clients read it, or take it as a constructor argument.

Python

from gigai_tools import Client, GigaiError

client = Client()  # reads GIGAI_API_KEY

# One call: import, run, export, download
client.run("merge-pdf", files=["a.pdf", "b.pdf"], output="merged.pdf")
client.run("compress-image", files=["photo.jpg"],
           options={"target_kb": 200}, output="small.jpg")
client.run("generate-qr", options={"text": "https://example.com"},
           output="qr.png")

# Files can be URLs - the server fetches them
client.run("pdf-to-text", files=["https://example.com/report.pdf"],
           output="report.txt")

try:
    client.run("split-pdf", files=["doc.pdf"], options={"pages": "99"})
except GigaiError as e:
    print(e.code, e.message, e.param)  # invalid_option ...

The lower-level surface mirrors the HTTP API: create_job, wait, cancel, jobs, file, delete_file, download, webhooks. Python 3.9+, stdlib only.

Node

import { Client, GigaiError } from "gigai-tools";

const client = new Client(); // reads GIGAI_API_KEY

await client.run("merge-pdf", { files: ["a.pdf", "b.pdf"], output: "merged.pdf" });
await client.run("generate-qr", { options: { text: "https://example.com" }, output: "qr.png" });

const job = await client.createJob({
  in:  { operation: "import/url", url: "https://example.com/report.pdf" },
  txt: { operation: "pdf-to-text", input: ["in"] },
  out: { operation: "export/url", input: ["txt"] },
});
const done = await client.wait(job.id);

Node 18+, no dependencies, ESM.

The gigai CLI

The Node package installs a gigai command:

export GIGAI_API_KEY=gk_live_...

gigai tools
gigai run merge-pdf a.pdf b.pdf -o merged.pdf
gigai run compress-image photo.jpg --target_kb 200 -o small.jpg
gigai run generate-qr --text "https://example.com" -o qr.png
gigai jobs
gigai cancel job_abc123

Pointing at a different host

Both clients honor GIGAI_API_BASE, and they rewrite signed result URLs onto that base. A tunnel, a staging box, or the api hostname before DNS settles all work without code changes.

Was this page helpful?