Skip to main content

🌀 SeaArt Python SDK

PyPI version Python 3.11+ License: MIT

Unofficial typed Python client for the SeaArt.ai API with sync and async support.

Installation

pip install seaart

Quick Start

Authentication

from seaart import SyncClient

with SyncClient() as client:
    client.auth.login(email="user@example.com", password="password")
from seaart import AsyncClient

async with AsyncClient() as client:
    await client.auth.login(email="user@example.com", password="password")

No account? Use tourist mode for quick access:

client.auth.login_as_tourist()

Character Chat

from seaart import SyncClient
from seaart.helpers import extract_character_link
from seaart.types import AppId

link = extract_character_link("https://www.seaart.ai/character/chat/...")
with SyncClient(app_id=AppId.APP) as client:
    client.auth.login(email="user@example.com", password="password")

    chat = client.characters.chats.create(link.character_id)
    result = client.characters.chats.send("Hello!", chat.value.session_id)
    print(result.text)
from seaart import AsyncClient
from seaart.helpers import extract_character_link
from seaart.types import AppId

link = extract_character_link("https://www.seaart.ai/character/chat/...")
async with AsyncClient(app_id=AppId.APP) as client:
    await client.auth.login(email="user@example.com", password="password")

    chat = await client.characters.chats.create(link.character_id)
    result = await client.characters.chats.send("Hello!", chat.value.session_id)
    print(result.text)

Image Generation

from seaart import SyncClient
from seaart.helpers import extract_model_link

model = extract_model_link("https://www.seaart.ai/create/image?id=...&model_ver_no=...")
with SyncClient() as client:
    client.auth.login(email="user@example.com", password="password")

    envelope = client.images.text_to_img(
        prompt="a serene mountain landscape at sunset, oil painting",
        model_no=model.model_no,
    )
    item = envelope.wait(timeout=120)
    print(item.image_url)
from seaart import AsyncClient
from seaart.helpers import extract_model_link

model = extract_model_link("https://www.seaart.ai/create/image?id=...&model_ver_no=...")
async with AsyncClient() as client:
    await client.auth.login(email="user@example.com", password="password")

    envelope = await client.images.text_to_img(
        prompt="a serene mountain landscape at sunset, oil painting",
        model_no=model.model_no,
    )
    item = await envelope.wait(timeout=120)
    print(item.image_url)

Features

  • Sync and async clients with identical APIs
  • Typed Pydantic v2 response models
  • SSE streaming for character chat
  • Task polling with envelope.wait()
  • Built on curl-cffi (HTTP/2, HTTP/3, browser impersonation)
  • Structured exception hierarchy

Requirements

Python 3.11 or higher.

Examples

File Description
quickstart.py Minimal working examples for chat and image generation
auth.py All authentication methods
characters_chat.py Chat, history, settings, voice audio
characters_stream.py SSE streaming for character responses
image_generation.py Text-to-image, img-to-img, upscaling, background removal
search.py Search characters, models, works with pagination
gen_agent.py GenAgent streaming and image attachments
async_usage.py Concurrent generation and streaming with AsyncClient
custom_requests.py Low-level request() and request_stream() for uncovered endpoints

Metadata

Release files for seaart 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 seaart 0.1.0
File Size Uploaded Provenance
seaart-0.1.0.tar.gz 194.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 347.6 kB

Release files / seaart-0.1.0.tar.gz

Download URL seaart-0.1.0.tar.gz
Size 194.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f481f430c2db0e306eb7e13e7a62c1f5ab0684a97eab52aee9c9b59561ea706b
BLAKE2b-256 checksum
How to use checksums
3c96535cddea1a78032f41fe68a1bb423a58c6275621d8364f5dd638705de614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

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

Download URL seaart-0.1.0-py3-none-any.whl
Size 153.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
821b13c73efe0fc4c391f6d9eea4e08d0a132493cbc7d2d391f7ca73c7038b77
BLAKE2b-256 checksum
How to use checksums
4e2a598838f9000ec9dc188a35f6ae465cc58a686b59456b7d88056ea0047842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for seaart 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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