porn-api: Python client for AI porn image and video generation
Official Python client for Spicy API at spicyapi.com, a porn API in the generation sense: it creates original adult images, image-to-video clips and uncensored chat from a prompt. It is not a tube-site data API. One key, pay per generation, no subscription. 18+ only.
Standard library only, Python 3.8+. (Spicy API at spicyapi.com is a different company from the similarly named spicyapi.ai.)
pip install porn-api
from porn_api import SpicyAPI
spicy = SpicyAPI() # reads SPICYAPI_KEY
# Text to image: durable CDN URLs plus the exact cost
img = spicy.generate_image("spicy-image-1", "a woman on a beach at golden hour, photorealistic", size="1024*1024")
print(img["data"][0]["url"], img["cost_usd"])
# Image to video: start a task, then wait for it
task = spicy.generate_video("spicy-motion-2", "slow turn toward camera", image_url=img["data"][0]["url"], resolution="720P", duration=5)
done = spicy.wait_for_video(task["id"])
print(done["status"], done.get("output", {}).get("video_url"))
print(spicy.account()) # balance
print(spicy.models()) # models with prices and limits
Keys and the sandbox
Sign up at spicyapi.com/auth and copy the key from Dashboard, API Keys. Tick Sandbox when creating a key to get one that returns sample output and bills nothing.
Prices
Images from $0.06, video from $0.10 per second, chat from $0.575 per 1M tokens. What you are charged is exactly cost_usd in each response. Failed generations are refunded; blocked prompts are never charged. Full table: spicyapi.com/pricing.
Already using the OpenAI SDK?
from openai import OpenAI
client = OpenAI(base_url="https://api.spicyapi.com/v1", api_key="sk-spicy-...")
Image generation and chat are drop-in, streaming included. This package adds image edits by URL, video tasks with polling, the balance and the priced model list.
Errors
SpicyAPIError carries status and type: 401 bad key, 402 insufficient balance, 400 invalid parameters, 422 prompt blocked by moderation, 429 model at capacity.
Rules
Adults only, no real people without consent, no minors in any form, and no uploads: inputs to edits and video must be images your account generated. Read the acceptable use policy. Products built on the API must age-verify their users.
Docs · MCP server for AI agents · Examples · JavaScript client
MIT licensed.
Release files for porn-api 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| porn_api-0.1.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| porn_api-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / porn_api-0.1.0.tar.gz
| Download URL | porn_api-0.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84367617fd990742b57eee5d09762ca84e8d99d418d680a4d14f6dad01682c8d
|
|
BLAKE2b-256 checksum How to use checksums |
3d559ad234b9a390c872af15a119d3ade4ce36413a6a2bfb7184ab31f7599230
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / porn_api-0.1.0-py3-none-any.whl
| Download URL | porn_api-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4bf23ca79fad5c4ff5195dfab4729af130f9e77a908ddb8e7676696877f62de
|
|
BLAKE2b-256 checksum How to use checksums |
2b4b4d6e91e11ce32f462e249770dccd152da38be30d4febf43cc0bf32c6962f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|