Official TypeScript and Python clients for the NinjaChat API: one API for chat, responses, images, video, routing, usage, request traces, and webhooks.
Important
NinjaChat API keys are server-side secrets. Never embed an nj_sk_ key in browser, mobile, desktop, or other distributed client code; route those requests through a backend you control and load keys from a secret manager or environment variable.
npm install @ninjachat/sdkimport { NinjaChat } from "@ninjachat/sdk";
const ninja = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const response = await ninja.responses.create({
model: "ninja/auto",
input: "Explain this API in one sentence.",
});
console.log(response.output_text);pip install ninjachatimport os
from ninjachat import NinjaChat
ninja = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
response = ninja.responses.create(
model="ninja/auto",
input="Explain this API in one sentence.",
)
print(response["output_text"])The clients default to https://www.ninjachat.ai/api/v1 and include typed errors, streaming helpers, retries that honor Retry-After, and idempotency keys for billing-safe retries.
Already using the OpenAI SDK? Keep it and change only base_url and the API key. The native NinjaChat SDK adds first-class routing, media, account usage, request traces, and webhook helpers.
packages/typescript—@ninjachat/sdkpackages/python—ninjachatopenapi/openapi.json— public OpenAPI 3.1 contract
Create an API key in the developer console, browse the documentation, or read the language-specific package guides.
TypeScript and Python packages share one version. An annotated vX.Y.Z tag runs the complete package test matrix and publishes through npm and PyPI Trusted Publishing; the repository stores no registry write tokens.
Maintainers should follow the complete release guide.
Please report vulnerabilities privately through GitHub Security Advisories. Do not open public issues for security reports.
MIT © Helium Technologies, Inc.