Skip to main content

Invi Labs Python SDK

Automate real iPhones through the Invi Labs API using your API key and phone ID. Non-jailbroken iPhones require Invi Dongle.

Install

python -m pip install invilabs

Requires Python 3.10 or newer. No third-party runtime dependencies.

Connect and run an action

Set INVI_API_KEY and INVI_PHONE_ID in your environment. Keep your API key private.

import os
from invilabs import Client

client = Client(os.environ["INVI_API_KEY"])
phone = client.phone(os.environ["INVI_PHONE_ID"])

print(phone.details())
phone.tap(100, 200)
phone.save_screenshot("screen.png")

Coordinates use full-resolution screenshot pixels. Calls block until completion; the SDK waits and retries when the phone reports device_busy. Uncertain execution is not automatically repeated. Use the operation key to look up its status.

AI generation

result = client.generate(
    "Generate an email address using example.com",
    result_type="email",
)
print(result["data"]["text"])
print(client.balance())

Generation supports text, usernames and email address strings, optionally using a local PNG/JPEG image. It does not create mailboxes. OCR, AI prompts and generation use your shared Account AI balance. No AI-provider key is required.

Features

  • Tap, swipe, scroll, type, explicit key presses and opening installed apps.
  • Screenshots as PNG bytes or saved to your computer.
  • Grouped OCR with text and bounding boxes.
  • Single-action AI prompts and structured screen answers.
  • Image/video import through Invi Helper on supported dongle phones.
  • Device details, balance and operation recovery.

All network operations use the public HTTPS API with your API key. The package contains client code and response contracts; phone control and AI processing run on Invi Labs services. API keys remain on your computer and are sent only as an authentication header to the configured API. HTTP redirects are not followed.

This is an initial release. Device support and feature verification limits are listed in the release notes.

Documentation · Quickstart · Generation and outputs · Errors and recovery

Typing completion

Version 0.1.1 waits for the dongle's final typing acknowledgment. Long typing and AI actions remain synchronous to Python while the SDK waits for the same server operation to finish. It never starts a second copy while waiting. Call phone.press("enter") after phone.type(text) returns to submit a search. A lost connection can still produce ExecutionUncertainError; inspect the recorded operation and phone state before deciding on another action.

Tap text with OCR (0.1.2)

result = phone.tap_text("Add a comment")
result = phone.tap_text(r"^(?:add|write) (?:a )?comment[.…]*$", regex=True)
print(result["point"], result["ocr"]["credits_charged"])

Matches the full trimmed OCR block case-insensitively by default; regex uses re.search. The tap lands randomly inside an inset of the block's bounds. Use randomize=False for its center. Multiple matches raise AmbiguousTextError unless a zero-based occurrence is supplied; no match raises TargetNotFoundError. Neither error taps. Regex substring matches use the whole block's box. Keep the screen stable between OCR and tap: these are two operations.

Returns match (OCR block), point (x, y pixels), ocr (blocks, credit charge, balance), and tap (execution status and coordinates). Only the normal OCR credit charge applies, including when no match is found. A tap failure retains the OCR result in error.details["ocr"]. This helper makes no VLM request.

Check text presence with OCR (0.1.2)

check = phone.text_exists("Continue", region="middle")
if check["exists"]:
    print(check["matches"])

check = phone.text_exists(r"^(?:add|write) (?:a )?comment[.…]*$", regex=True, region="bottom")
check = phone.text_exists("Comments", region=(0, 900, 1170, 600))

Omit region for the full screen. Named regions are full-width horizontal thirds; custom tuples are (x,y,width,height) in original screenshot pixels. A block's center determines region membership. Literal and regex rules match tap_text. Returns exists (bool), matches (OCR blocks), region (resolved pixel box or None), and ocr (full result with charge and balance). Check result["exists"], not the dictionary's truthiness. No match is False; OCR failures raise errors. One billed full-screen OCR request is made regardless of region or match count. Named regions also read dimensions before and after OCR and reject geometry changes. This method never taps or calls a VLM.

Release files for invilabs 0.1.3

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

Source distribution (sdist)

Source distribution for invilabs 0.1.3
File Size Uploaded
invilabs-0.1.3.tar.gz 20.3 kB Details

Built distribution (wheel)

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

Total release size: 41.1 kB

Release files / invilabs-0.1.3.tar.gz

Download URL invilabs-0.1.3.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9c4dcba118c30ef6ea25175d494871d786a731303555ddfd28e0fbf745dcd577
BLAKE2b-256 checksum
How to use checksums
039c61d7f06fa4adfa210587253f078dd79bdc21cc9a14c40e068c67373cf322
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 13, 2026.

Transparency log

Release files / invilabs-0.1.3-py3-none-any.whl

Download URL invilabs-0.1.3-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
029505dbc8406cf8d9b60b670f694483da975f27a3d953f0e6fb430434ffb541
BLAKE2b-256 checksum
How to use checksums
534edfb775a1d63f021227e0a94424aca36c03aff32cec7f1265ef5b8f940950
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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