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

0.1.0 is the version in this repo; until it reaches PyPI, install from the repository instead: pip install ./python. Requires Python 3.9+.

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.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 ninetile 0.1.0
File Size Uploaded Provenance Actions
ninetile-0.1.0.tar.gz 8.2 kB With provenance Details for ninetile-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 16.8 kB

Release files / ninetile-0.1.0.tar.gz

Download URL ninetile-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a9d485972eedd401acbba6ab63247c0e70e1a13698cac9757568c7e01f2c21ad
BLAKE2b-256 checksum
How to use checksums
1b6c8ee902189afa396ae16459120ed29742c63e54dadd0a076e88e37a31e944
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.0-py3-none-any.whl

Download URL ninetile-0.1.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
901c32390ce63a36e0f56dd5a4d21b97953dbee6094bec8a247e09ee6afaea12
BLAKE2b-256 checksum
How to use checksums
5ea801d714de2a99e03aa64905e7b0d67d773415e7527ce32e92e5e81b834382
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.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 ninetile-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 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.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