Official client libraries for the Pre.dev Architect API in Python and Node.js/TypeScript.
Generate comprehensive software specifications using AI-powered analysis with a simple, consistent API across both languages.
This repository contains two client libraries with matching APIs:
Python client for the Pre.dev Architect API with full type hints support.
Quick Start:
from predev_api import PredevAPI
predev = PredevAPI(api_key="your_api_key")
result = predev.fast_spec("Build a task management app")Modern TypeScript/Node.js client using ES6+ modules with full type definitions.
Quick Start:
import { PredevAPI } from 'predev-api';
const predev = new PredevAPI({ apiKey: 'your_api_key' });
const result = await predev.fastSpec({ input: 'Build a task management app' });Both libraries provide:
- Build with the agent (
client.agent): create a project from a prompt, stream the agent's work, build the plan, check status and credits - Fast Spec Generation: Comprehensive specifications quickly - perfect for MVPs and prototypes
- Deep Spec Generation: Ultra-detailed specifications for complex systems with enterprise-grade depth
- Async Spec Generation: Non-blocking async methods for long-running requests
- Status Tracking: Check the status of async specification generation requests
- Enterprise Support: Both solo and enterprise authentication methods
- Type Safety: Full type hints (Python) and TypeScript definitions (Node.js)
- Direct Spec Data: JSON + markdown payloads returned inline alongside S3 URLs
- Error Handling: Custom exceptions for different error scenarios
- Modern Conventions: Latest language features and best practices
Get your API key from the pre.dev dashboard
Generate comprehensive specifications quickly with balanced depth and speed.
Python:
result = predev.fast_spec(
input_text="Your project description"
)TypeScript:
const result = await predev.fastSpec({
input: "Your project description"
});Generate ultra-detailed specifications for complex systems with comprehensive analysis.
Python:
result = predev.deep_spec(
input_text="Your complex project description"
)TypeScript:
const result = await predev.deepSpec({
input: "Your complex project description"
});Generate specifications asynchronously for long-running requests.
Python:
# Fast spec async
result = predev.fast_spec_async(
input_text="Your project description"
)
# Returns: AsyncResponse with specId
# Deep spec async
result = predev.deep_spec_async(
input_text="Your complex project description"
)
# Returns: AsyncResponse with specIdTypeScript:
// Fast spec async
const result = await predev.fastSpecAsync({
input: "Your project description"
});
// Returns: AsyncResponse with specId
// Deep spec async
const result = await predev.deepSpecAsync({
input: "Your complex project description"
});
// Returns: AsyncResponse with specIdCheck the status of an async specification generation request.
Python:
status = predev.get_spec_status("spec_id")TypeScript:
const status = await predev.getSpecStatus("spec_id");const { projectId } = await predev.agent.createProject({ prompt: 'A habit tracker' });
for await (const ev of predev.agent.stream(projectId)) {
if (ev.event === 'message.delta') process.stdout.write(ev.data.delta);
}
await predev.agent.buildNext(projectId);
console.log(await predev.agent.status(projectId));project_id = predev.agent.create_project("A habit tracker")["projectId"]
for event in predev.agent.stream(project_id):
if event["event"] == "message.delta":
print(event["data"]["delta"], end="")
predev.agent.build_next(project_id)
print(predev.agent.status(project_id))Methods: createProject / create_project, send, stream, buildNext / build_next, buildAll / build_all, status, stop. See each package README.
Releases publish from CI (.github/workflows/release.yml) when a v* tag is pushed:
- Bump the version in
predev-api-node/package.json,predev-api-python/setup.pyandpredev-api-python/predev_api/__init__.py(all three must match), merge tomain. - Tag the merge commit and push the tag:
git tag v1.2.0 && git push origin v1.2.0. - The workflow checks the tag matches all three versions, runs
make check, then publishespredev-apito npm (with provenance) and to PyPI.
Repo secrets: NPM_TOKEN (npm automation token for predev-api) and PYPI_API_TOKEN (PyPI API token scoped to predev-api). scripts/deploy.sh remains for manual releases.
Both packages include comprehensive examples in their respective examples/ directories:
cd predev-api-python
export PREDEV_API_KEY="your_api_key"
python examples/fast_spec_example.py
python examples/deep_spec_example.py
python examples/get_status_example.pycd predev-api-node
export PREDEV_API_KEY="your_api_key"
npm run build
npx tsx examples/fastSpecExample.ts
npx tsx examples/deepSpecExample.ts
npx tsx examples/getStatusExample.ts