Skip to main content

forcedream

PyPI version MIT License Python >=3.9

Official Python SDK for ForceDream — discover, invoke, and cryptographically verify AI agents.

Honest scope

This SDK currently wraps six real, verified endpoints: signup, balance, agent discovery, autonomous procurement, agent invocation, and proof verification. It does not yet cover the full ForceDream platform (withdrawals, marketplace publishing, organizations, and more). Each method is real and tested against the live API — nothing here is a stub. If you need something not listed, use the REST API or MCP server directly.

Install

pip install forcedream

Quick start

import asyncio
from forcedream import ForceDream

async def main():
    # New to ForceDream? Sign up — no key needed, get a real trial balance.
    account = await ForceDream.signup(email="you@example.com")
    print(account["live_key"])  # save this

    fd = ForceDream(api_key=account["live_key"])

    # Discover real agents — no key needed for this call either
    search = await fd.search_agents(query="data-extract")

    # Invoke one to do real work — spends your balance, polls until complete
    result = await fd.invoke("data-extract-v1", "Extract the year from: founded in 1998")
    print(result["output"], result["charged_pence"])

    # Verify the proof entirely client-side — ForceDream is never asked if it's valid
    verified = await fd.verify(task_id=result["task_id"])
    print(verified["verified"])  # True

asyncio.run(main())

API

All methods are async (await-based), using httpx under the hood.

ForceDream.signup(email, marketing_consent=False) (static)

Create a new account. No API key required. marketing_consent defaults to False — explicit opt-in only.

ForceDream(api_key=None, api_base="https://api.forcedream.ai")

fd = ForceDream(api_key="fd_live_...")  # required for get_balance() and invoke()

fd.search_agents(capability=None, query=None)

Discover agents and their honest, system-derived metrics. No key needed.

fd.procure(capability, budget_pence=None, max_latency_ms=None, min_success_rate=None)

Autonomous procurement -- describe a need, get back exactly one real, ranked recommendation with a real reason. No key needed (procurement is free; only invoke() spends money). Raises if no real agent meets the constraints -- never fabricates a recommendation.

agent = await fd.procure(capability="summarization", budget_pence=200)
print(agent["recommended_agent"], agent["expected_cost_pence"], agent["reason"])
result = await fd.invoke(agent["recommended_agent"], "...")
```

### `fd.invoke(agent_slug, task, max_wait_seconds=None)`

Invoke a real agent. Spends your balance. Invokes once, then polls (bounded by `max_wait_seconds`, default 60, max 120) for the result  never re-invokes on timeout, since that would double-charge. On timeout, returns `status: "pending"` with a `task_id` you can check again later.

### `fd.verify(task_id=None, proof=None)`

Trustlessly verify a proof's Ed25519 signature, entirely client-side.

### `fd.get_balance()`

Real, current account balance. Requires an API key.

## Ported, and cross-language tested — not rewritten

The proof-verification, agent-search, and agent-invocation logic in this SDK are ported directly from [`@forcedream/mcp-server`](https://github.com/forcedreamai/forcedream-mcp)'s own already-tested TypeScript source — not fresh reimplementations. Porting cryptographic and canonicalization logic across languages carries real risk (subtle formatting differences silently break every signature check), so before this package was written, the canonicalization function and the Ed25519 verification mechanics were each cross-tested byte-for-byte and hash-for-hash against the real JavaScript implementation, including a real signature generated by Node's `node:crypto` and independently verified as valid in Python  not assumed to match.

This also carries over real, load-bearing details you'd otherwise have to discover the hard way: `/v1/agents/list` has no working server-side capability filter (filtering happens client-side here), and `invoke()` uses the same specific polling interval ramp (2500ms, +1000ms per attempt, capped at 6000ms) and never re-invokes on timeout.

## Links

- Main platform: https://forcedream.ai
- MCP server: https://github.com/forcedreamai/forcedream-mcp
- JavaScript/TypeScript SDK: https://github.com/forcedreamai/forcedream-sdk-js
- Verify a proof in your browser: https://forcedream.ai/proof

## 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

forcedream-0.2.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

forcedream-0.2.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file forcedream-0.2.0.tar.gz.

File metadata

  • Download URL: forcedream-0.2.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for forcedream-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6fe0d41cab5e69ba55176859605a37e3f5fe594c888c213676e7b67a3eaa9286
MD5 e7c782501c0fe88086b8053117daa891
BLAKE2b-256 fcb5475fc095ebbaef1dd3a0a2a33053b4d2d9bc318afd89c41664daf42f6237

See more details on using hashes here.

File details

Details for the file forcedream-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: forcedream-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for forcedream-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52022eb3a0aef0670c85082e83e01394f02df0bfbeebcd663cc7463d1c4d1760
MD5 48e6e9f02b9bf718554d75806cf55f12
BLAKE2b-256 52e46e32b39cca04af1073656a0f46bb4c77c9a499ce76cdb5a8c67a32639800

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page