Skip to main content

AI Checker Humanizer for LangChain

Use the AI detection API to score a draft and the AI humanizer API to rewrite it.

Install

The package requires langchain-core 1.x.

pip install langchain-aicheckerhumanizer

Create a key on your account page and set AICHECKERHUMANIZER_API_KEY in your environment.

Call the tools directly

from pathlib import Path

from langchain_aicheckerhumanizer import AICheckerHumanizerToolkit

toolkit = AICheckerHumanizerToolkit()
detect, humanize, get_result = toolkit.get_tools()
text = Path("draft.txt").read_text(encoding="utf-8")

print(detect.invoke({"text": text}))
rewrite = humanize.invoke({"text": text, "mode": "standard", "strength": "medium"})
print(rewrite)

Each tool returns a JSON string on success and supports ainvoke. Detection accepts up to 10,000 words and can return a null score with a reason. Rewriting accepts up to 3,000 words.

  • Mode can be standard (default), academic, casual or concise.
  • Strength can be light, medium (default) or heavy.

By default, the rewrite tool waits up to 120 seconds after submission, including the status checks and the pauses between them. Set humanize.max_wait_seconds to change the limit.

If the rewrite is still pending when polling stops, you get the taskId and last known status. If polling stops after a temporary error such as a malformed response, the result also includes an error code. Check again with get_result.invoke({"task_id": task_id}). The result is available for about 70 minutes after submission.

When the API reports an expired result, get_result returns result_expired with httpStatus 410. Resubmitting with the same idempotency_key within 24 hours reports the same error. The response also includes taskStatus, creditsCharged and expiredAt when available.

skippedWords counts words left unchanged because their language is unsupported or the chosen mode is unavailable for that language. If a status check leaves out skippedWords, the rewrite tool uses the count from submission when available.

With the default error handling, a failed tool call returns a JSON string with the API's error fields and httpStatus if the server responded.

Use the toolkit in an agent

Run pip install langchain and install the provider package for your chat model. Choose a model that supports tool calls, set MODEL to its provider:model identifier and configure the provider's credentials.

import os

from langchain.agents import create_agent
from langchain.chat_models import init_chat_model

from langchain_aicheckerhumanizer import AICheckerHumanizerToolkit

toolkit = AICheckerHumanizerToolkit()
agent = create_agent(init_chat_model(os.environ["MODEL"]), tools=toolkit.get_tools())

See examples/agent.py for a complete invocation.

Credits

Detection costs 1 credit per scored word when there is a verdict. Rewriting costs 5 credits per original word in each chunk it successfully rewrites. A chunk is a paragraph or part of a long paragraph. Chunks under 10 words count as 10 for billing.

Reuse the same idempotency_key, text and options within 24 hours to avoid another charge for a completed check or accepted rewrite. The detect and rewrite tools generate a key when you omit it.

The server may have accepted a submission even if it times out or the connection drops. When the error JSON includes idempotencyKey, retry the same request with that value as idempotency_key. The tools also return the key after decoding errors, malformed 2xx responses, HTTP 5xx and in_progress.

When a rewrite has status failed or cancelled, the old key still points to that task. To start a fresh rewrite, leave idempotency_key out or pass a new one. This also applies to results with reason not_humanized, which use no credits.

See the API documentation for response fields, errors and service limits.

Metadata

Release files for langchain-aicheckerhumanizer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-aicheckerhumanizer 0.1.0
File Size Uploaded Provenance Actions
langchain_aicheckerhumanizer-0.1.0.tar.gz 19.8 kB With provenance Details for langchain_aicheckerhumanizer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-aicheckerhumanizer 0.1.0
File Interpreter ABI Platform Actions
langchain_aicheckerhumanizer-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_aicheckerhumanizer-0.1.0-py3-none-any.whl

Total release size: 31.8 kB

Release files / langchain_aicheckerhumanizer-0.1.0.tar.gz

Download URL langchain_aicheckerhumanizer-0.1.0.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
188d73cba89902c76a4b84fa97c58c85a5d702e0edfce7b227ec1509ad91e908
BLAKE2b-256 checksum
How to use checksums
87a727fa30b1adaccd6f8d10f72d7bc386e3deb713c9112036687e94e3a21dac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / langchain_aicheckerhumanizer-0.1.0-py3-none-any.whl

Download URL langchain_aicheckerhumanizer-0.1.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ac30b257892f0c337dca847e762e7736841eff43aa7af3fad6a2d5d82cb0561
BLAKE2b-256 checksum
How to use checksums
6a68971ecf93e5796cf483a859467ddec0c03d014a872ff4c095acc94007d6f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for langchain-aicheckerhumanizer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_aicheckerhumanizer-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page