Skip to main content

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

promtexpress-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

promtexpress-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for promtexpress-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf840f9bccef0d421d936fe837761a50c2eb91fa5f4844b1651c99042978ce49
MD5 196e8991bb4cfdb2589618b587594b91
BLAKE2b-256 e60e4437b634c6ecb77674193c164cfbdbac813928109479d36e3bb5ab14ad6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for promtexpress-0.1.0.tar.gz:

Publisher: release-python.yml on WebitroHQ/promtexpress-oss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for promtexpress-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68ef9485c42f953abf8fb45b1beb5fcc69e836c2dff7e14a776c39465e19cb84
MD5 7ad44f4dabb581ca0dfa351f842babeb
BLAKE2b-256 67308f70475b266ada5aa9da2070522655a0f645338925ff4cfeb6b697e6948e

See more details on using hashes here.

Provenance

The following attestation bundles were made for promtexpress-0.1.0-py3-none-any.whl:

Publisher: release-python.yml on WebitroHQ/promtexpress-oss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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