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"])
Errors
All errors inherit from PromtExpressError: InvalidRequestError (400), AuthenticationError (401), 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).
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promtexpress-0.1.0.tar.gz.
File metadata
- Download URL: promtexpress-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf840f9bccef0d421d936fe837761a50c2eb91fa5f4844b1651c99042978ce49
|
|
| MD5 |
196e8991bb4cfdb2589618b587594b91
|
|
| BLAKE2b-256 |
e60e4437b634c6ecb77674193c164cfbdbac813928109479d36e3bb5ab14ad6c
|
Provenance
The following attestation bundles were made for promtexpress-0.1.0.tar.gz:
Publisher:
release-python.yml on WebitroHQ/promtexpress-oss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
promtexpress-0.1.0.tar.gz -
Subject digest:
bf840f9bccef0d421d936fe837761a50c2eb91fa5f4844b1651c99042978ce49 - Sigstore transparency entry: 2817828337
- Sigstore integration time:
-
Permalink:
WebitroHQ/promtexpress-oss@6164abbb31352d2cfa55f0f59a3a13b852542684 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/WebitroHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@6164abbb31352d2cfa55f0f59a3a13b852542684 -
Trigger Event:
push
-
Statement type:
File details
Details for the file promtexpress-0.1.0-py3-none-any.whl.
File metadata
- Download URL: promtexpress-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68ef9485c42f953abf8fb45b1beb5fcc69e836c2dff7e14a776c39465e19cb84
|
|
| MD5 |
7ad44f4dabb581ca0dfa351f842babeb
|
|
| BLAKE2b-256 |
67308f70475b266ada5aa9da2070522655a0f645338925ff4cfeb6b697e6948e
|
Provenance
The following attestation bundles were made for promtexpress-0.1.0-py3-none-any.whl:
Publisher:
release-python.yml on WebitroHQ/promtexpress-oss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
promtexpress-0.1.0-py3-none-any.whl -
Subject digest:
68ef9485c42f953abf8fb45b1beb5fcc69e836c2dff7e14a776c39465e19cb84 - Sigstore transparency entry: 2817828391
- Sigstore integration time:
-
Permalink:
WebitroHQ/promtexpress-oss@6164abbb31352d2cfa55f0f59a3a13b852542684 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/WebitroHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@6164abbb31352d2cfa55f0f59a3a13b852542684 -
Trigger Event:
push
-
Statement type: