API Docs

SDKs for two languages

Official Python and Node.js wrappers around the Inksong REST API. Install from PyPI or npm — source lives in this repo for inspection.

Two SDKs, one source of truth

The Node.js client is published to npm as @epigrams/inksong-sdk (under the parent-company scope; Epigrams operates Inksong). The Python client publishes to PyPI as inksong. Both wrap the same REST API at api.inksong.app and ship source-of-truth in this repo at sdks/.

Python

The inksong package

Requires Python 3.10+. Single dependency: httpx.

# Once published to PyPI:
pip install inksong

# Today, from the repo:
pip install ./sdks/inksong-python

Usage

from inksong import InksongClient

with InksongClient(api_key="ink_...") as client:
    out = client.humanize_text(
        "Your AI-generated draft here",
        tone="balanced",
        humanness_level=50,
    )
    print(out["humanized_text"])

Webhook verification

from inksong import verify_signature

ok = verify_signature(SECRET, request.body, request.headers["Webhook-Signature"])
if not ok:
    return Response(status_code=400)

Node.js / TypeScript

The @epigrams/inksong-sdk package

Requires Node 18+ (uses the global fetch and crypto.subtle). Works in modern browsers too — safe to ship in client code as long as you proxy the API key through your server.

npm install @epigrams/inksong-sdk

Usage

import { InksongClient } from "@epigrams/inksong-sdk";

const inksong = new InksongClient({ apiKey: process.env.INKSONG_API_KEY! });

const out = await inksong.humanize.text("Your AI-generated draft here", {
  tone: "balanced",
  humanness_level: 50,
});
console.log(out.humanized_text);

Webhook verification

import { verifyWebhookSignature } from "@epigrams/inksong-sdk";

const ok = await verifyWebhookSignature(
  process.env.INKSONG_WEBHOOK_SECRET,
  rawBody,
  req.headers["webhook-signature"],
);
if (!ok) return res.status(400).end();

No SDK?

Use the REST API

If you’re on a language we don’t cover, the REST API is documented end-to-end at /docs. Three endpoints do almost everything you need: POST /humanize/text, GET /documents/{job_id}, POST /documents/upload. Both SDKs are 200-line wrappers over the same calls — a Go port would be straightforward.