promtexpress
Official Python client for the PromtExpress API. Standard library only, Python 3.9+.
pip install promtexpress
Usage
from promtexpress import PromtExpress
client = PromtExpress() # reads PROMTEXPRESS_API_KEY
result = client.generate(
"product launch email for a note-taking app, friendly tone",
"text", # text | code | image | video | audio | music
)
print(result["output"])
print(result["creditsRemaining"], "credits left")
Clarifying questions and iteration
if result.get("chipQuestions"):
better = client.generate(
"product launch email for a note-taking app",
"text",
answers=[{"question": result["chipQuestions"][0]["label"], "answer": "developers"}],
)
refined = client.generate(
"product launch email for a note-taking app",
"text",
iteration={"ofPromptId": result["promptId"], "feedback": "shorter, mention the free tier"},
)
Templates and history
templates = client.list_templates(modality="image")
page = client.list_history(page=0, limit=50)
for entry in client.iter_history(modality="video"):
print(entry["date"], entry["title"])
API key scopes
Create keys in the PromtExpress dashboard under API Keys. The read scope covers list_templates, list_history and iter_history; generate covers generate (consumes credits); admin allows everything. Each key has its own rate limit.
Errors
All errors inherit from PromtExpressError: InvalidRequestError (400), AuthenticationError (401), PermissionDeniedError (403, with missing_scope), InsufficientCreditsError (402, with remaining and required), RateLimitError (429, with retry_after), ServerError (5xx) and APIConnectionError (network or timeout).
Time-based rate limits are retried automatically (max_retries, default 2).
Contributors
Everyone who has shipped a commit or authored a template in promtexpress-oss. New templates, translations and fixes are welcome: see the open issues.
SpicesFire 11 commits · 10 templates |
resularabaci 2 commits · 2 templates |
License
MIT
Metadata
Release files for promtexpress 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| promtexpress-0.2.1.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| promtexpress-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.6 kB
Release files / promtexpress-0.2.1.tar.gz
| Download URL | promtexpress-0.2.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fcf843104e7e4f4308c187dd60df151507190e37f62dbec94b3a9483c9e9565e
|
|
BLAKE2b-256 checksum How to use checksums |
f3db224e9871ff2cfd0c5c39283240a8ea4762a986cedf5ab9e26e5a7cd228a5
|
| 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 15, 2026.
Transparency logRelease files / promtexpress-0.2.1-py3-none-any.whl
| Download URL | promtexpress-0.2.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d100c03863c1056323a0c3007b46c5bfdb656fbc8c58fcb148f3c2a8c318820a
|
|
BLAKE2b-256 checksum How to use checksums |
bffe9a1ac430111815839aef3600e861f818f19343ff4a884d1bc9f6603f3324
|
| 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 15, 2026.
Transparency log