Skip to main content

ninetile

Official Python client for the Ninetile API — send a sitekey and URL, get back a token your form can submit, or send a challenge's images and get back where to click.

CI PyPI version Python versions License

Install

pip install ninetile

Requires Python 3.9+. For a version newer than the last release, pip install ./python installs straight from this repository.

Get a key at ninetile.io/signup; the key (nt_live_…) is shown once. Every request sends Authorization: Bearer nt_live_….

Browser identity

Do not send a user_agent. The API refuses it with 422 validation_error (param: "user_agent") because a token is minted inside one coherent browser identity — User-Agent, Sec-CH-UA client hints and platform must agree — and an arbitrary string breaks that agreement. Submit the token with the solve.user_agent the API returns; an empty string is treated as omitted. The client passes unknown keyword fields through to the request body, so client.solve(..., user_agent="...") reaches the API and is refused.

Quick start

Sync:

from ninetile import NinetileClient

client = NinetileClient()  # reads NT_API_KEY
solve = client.solve("00000000-0000-0000-0000-000000000000", "https://target.example/login", wait=30)
print(solve.status, solve.token)

Async:

import asyncio
from ninetile import AsyncNinetileClient

async def main():
    async with AsyncNinetileClient() as client:  # reads NT_API_KEY
        solve = await client.solve("00000000-0000-0000-0000-000000000000", "https://target.example/login", wait=30)
        print(solve.status, solve.token)

asyncio.run(main())

Submit solve.token with the User-Agent from solve.user_agent — tokens are single-use and expire within minutes. Omit wait to have the client poll instead of holding the connection open server-side; solve() blocks (or awaits) until the solve is final and raises SolveFailed if it ends without a token. client.recognize(task=..., image_data=[...]) answers a challenge's images instead of minting a token; AsyncNinetileClient has the same methods, awaited.

Errors

Every non-2xx response has the same shape: {"error": {"code", "message", "param", "request_id"}}. The SDK raises typed exceptions — AuthenticationError (401), InsufficientCredits (402), RateLimited (429, with retry_after; honour Retry-After), else NinetileError — each carrying code, status and request_id (quote request_id, or the X-Request-Id response header, when you contact support). A solve can also end without a token: SolveFailed, with retryable and reason — never an HTTP error, and never charged. Failed work is never charged; retry only when the solve's error.retryable is true, and only by calling solve() again — the create call is never retried silently.

Metadata

Release files for ninetile 0.1.1

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

Source distribution (sdist)

Source distribution for ninetile 0.1.1
File Size Uploaded Provenance Actions
ninetile-0.1.1.tar.gz 8.2 kB With provenance Details for ninetile-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ninetile 0.1.1
File Interpreter ABI Platform Actions
ninetile-0.1.1-py3-none-any.whl Python 3 none any Details for ninetile-0.1.1-py3-none-any.whl

Total release size: 16.8 kB

Release files / ninetile-0.1.1.tar.gz

Download URL ninetile-0.1.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a9cb8f75747eed5e0cfe9cd44e8025395a91149daf1be7044e516f1e7259b202
BLAKE2b-256 checksum
How to use checksums
b9b362d6ccd23e99fc6e01215b7d147710d61c6bf56105331db8df51b0fcddfc
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 12, 2026.

Transparency log

Release files / ninetile-0.1.1-py3-none-any.whl

Download URL ninetile-0.1.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b58b8de48ac93ea447500dd0c8addc1d19e5316d5e014dc0d2f5a7892e170ded
BLAKE2b-256 checksum
How to use checksums
e252cca18a4116a35b87f312da3b405cbbf2005f5df91fcb8123a37520104c3a
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 12, 2026.

Transparency log

Security for ninetile 0.1.1

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 ninetile-0.1.1.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 12, 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.1 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