SDK generators
Our OpenAPI 3.1 spec at https://api.on-page.ai/openapi.json is the source of truth for every endpoint, response shape, error body, and outbound webhook event. Generate a typed client for your language in one command.
Official support
We verify the TypeScript and Python generators on every spec change via a CI smoke test (see scripts/sdk-smoke.sh). Other generators (go, php, rust, java, …) are community-supported — they consume the same spec and should work, but we don't run CI against them.
TypeScript
CI-verifiedtypescript-fetchInstall the generator CLI:
npm i -D @openapitools/openapi-generator-cliGenerate the client:
npx --yes @openapitools/openapi-generator-cli generate \
-i https://api.on-page.ai/openapi.json \
-g typescript-fetch \
--additional-properties=npmName=onpage-sdk-ts,supportsES6=true \
-o ./onpage-sdk-tsPython
CI-verifiedpythonInstall the generator CLI:
npm i -D @openapitools/openapi-generator-cli # Python generator is Node-drivenGenerate the client:
npx --yes @openapitools/openapi-generator-cli generate \
-i https://api.on-page.ai/openapi.json \
-g python \
--additional-properties=packageName=onpage_sdk_py \
-o ./onpage-sdk-pyFirst call example
After generating the client, submit a job and get back a job_id you can poll.
TypeScript:
import { Configuration, NLPApi } from "./onpage-sdk-ts";
const nlp = new NLPApi(
new Configuration({ accessToken: process.env.ONPAGE_API_KEY }),
);
const job = await nlp.createClassifyJob({
classifyRequestSchema: { text: "Breaking: AI detects fraud in real-time." },
});
console.log(job.jobId); // poll /v1/jobs/:id until terminalPython:
from onpage_sdk_py import Configuration, ApiClient, NLPApi
import os
api = NLPApi(ApiClient(Configuration(access_token=os.environ["ONPAGE_API_KEY"])))
job = api.create_classify_job(
classify_request_schema={"text": "Breaking: AI detects fraud in real-time."}
)
print(job.job_id) # poll /v1/jobs/:id until terminalGenerated classes are grouped by OpenAPI tag (NLP, Scan, Jobs, Credits, Webhooks). Exact class and method names depend on the generator version — after running the command, check the generated tree (usually under onpage-sdk-*/src/apis/ for TypeScript or onpage_sdk_py/api/ for Python) for the real identifiers.
Prefer to explore interactively?
Skip the generator entirely — paste your API key into the interactive API reference and hit any endpoint from your browser.