forgefy
Official Python SDK for the Forgefy Developer API — transcripts in, structured product requirements (features, open questions, conflicts, action items) out.
Python 3.10+. One dependency (httpx).
pip install forgefy
Quick start
import os
from forgefy import Forgefy
client = Forgefy(
api_key=os.environ["FORGEFY_API_KEY"], # fgy_live_… from the dashboard's Developers page
base_url="https://your-forgefy-host", # or set $FORGEFY_API_URL
)
result = client.extract(
"We need Google login before launch. Sarah owns billing.",
extractors=["features", "action_items"], # optional — omit to run all four
)
for f in result["features"]:
print(f"[{f['priority']}] {f['title']}")
print(result["usage"]) # {"input_tokens": ..., "output_tokens": ...}
Long transcripts (async jobs)
job = client.jobs.create(
long_transcript, # up to 200k chars
webhook_url="https://yourapp.com/hooks/forgefy", # optional
)
# Either wait by polling…
done = client.jobs.wait_for(job["job_id"]) # raises JobFailedError / JobTimeoutError
print(done["result"])
# …or verify the webhook delivery instead:
from forgefy import verify_signature
@app.post("/hooks/forgefy")
async def hook(request):
raw = await request.body() # raw bytes — verify BEFORE parsing JSON
if not verify_signature(raw, request.headers.get("x-forgefy-signature"), job["webhook_secret"]):
return Response(status_code=401)
event = json.loads(raw) # {"type", "job_id", "status", "result"?, "error"?}
return Response(status_code=200)
jobs.create() sends an auto-generated Idempotency-Key, so a network-level
retry can never run the same job twice. Pass idempotency_key= yourself to
dedupe across processes.
Errors
All API failures raise typed subclasses of ForgefyError with .status and .detail:
| Class | When |
|---|---|
AuthenticationError |
401 — bad or revoked key |
QuotaExceededError |
402 — monthly tokens exhausted (free tier); detail has the reset date |
NotFoundError |
404 |
ValidationError |
422 |
RateLimitError |
429 — 60 req/min per key (retried automatically first) |
ServerError |
5xx |
APIConnectionError |
no HTTP response at all |
Retry behavior: 429 and network errors are always retried (default 2 retries,
exponential backoff, Retry-After honored). 5xx is retried only where safe —
GETs and idempotent job creation, never the sync extract() (a retry would
bill tokens twice).
Quota
usage = client.usage()
# {"tier", "monthly_tokens", "tokens_used", "tokens_remaining", "resets_at"}
Paid accounts over budget aren't blocked — requests are served by the free
economy model instead. Check result["model_tier"] to see which tier answered.
Development
# from forgefy-backend/, using its venv (httpx + pytest already installed)
python -m pytest sdks/python/tests -q
Release files for forgefy 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 | |
|---|---|---|---|
| forgefy-0.1.0.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| forgefy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / forgefy-0.1.0.tar.gz
| Download URL | forgefy-0.1.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77d2a76d32a066d822ae6fa83826cc633b30eba636c3f131388fb6298cc9a7d1
|
|
BLAKE2b-256 checksum How to use checksums |
e4083a7c1a52335d8174d546896450027fb828ea1cb300151245c1f996b23f74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / forgefy-0.1.0-py3-none-any.whl
| Download URL | forgefy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d53cd6f12e029b16b412eaeec6b6256658cc418d5168df475b2646cb063af5c0
|
|
BLAKE2b-256 checksum How to use checksums |
64912a0f7d33fc37ff76ebd960152c15194d871d926ea6b7961a0e7af86022b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|