Metadata-Version: 2.5
Name: moneytools-transcripts
Version: 0.1.2
Summary: Pay-per-file transcription over x402 (USDC on Base): official MoneyTools Transcripts client with a dTelecom-compatible file API and CLI mt-transcribe, plus a pay-per-call MoneyTools Settle client. No prepaid credits.
Project-URL: Homepage, https://speech.moneytools.dev/migrate/dtelecom
Project-URL: Documentation, https://speech.moneytools.dev/llms.txt
Author-email: MoneyTools <support@moneytools.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,base,dtelecom,speech-to-text,srt,transcription,usdc,x402
Requires-Python: >=3.10
Requires-Dist: eth-account>=0.13
Requires-Dist: requests>=2.31
Requires-Dist: x402[evm,requests]<3,>=2.27
Description-Content-Type: text/markdown

# moneytools-transcripts

Pay-per-file speech-to-text for [MoneyTools Transcripts](https://speech.moneytools.dev), over [x402](https://www.x402.org) (USDC on Base).

- **$0.005 per started audio minute**, no prepaid credits
- Same REST shape as dTelecom's `POST /v1/transcriptions/jobs` + poll
- Uses the official `x402` Python client (`x402[requests,evm]`) to answer HTTP 402 automatically
- CLI: `mt-transcribe meeting.mp3`

## Install

```bash
pip install moneytools-transcripts
```

## Usage

```python
import os
from eth_account import Account
from moneytools_transcripts import TranscriptsClient

account = Account.from_key(os.environ["X402_PRIVATE_KEY"])  # Base wallet with a little USDC
tc = TranscriptsClient(account)  # https://speech.moneytools.dev, Base mainnet

job = tc.transcribe_file("meeting.mp3", language="en", idempotency_key="meeting-42")
done = tc.wait_for_job(job["id"])
print(done["result"]["text"])
print(tc.get_job(job["id"], fmt="srt"))
```

A public `https` media URL:

```python
job = tc.transcribe_url("https://example.com/meeting.mp3", wait=True)
```

Unpaid price check (no signature):

```python
quote = tc.quote_file("meeting.mp3")
print(quote["amountUsd"], quote["startedMinutes"])
```

Spend cap: `TranscriptsClient(account, max_usd_per_request=0.05)`.

## Settle (agent spend controls, pay-per-call)

```python
from moneytools_transcripts import SettleClient
settle = SettleClient(account)  # or api_key="mts_..."; default cap 0.05 USDC per call
settle.spend_check(payer=account.address, amount_usd="0.40", host="api.example.com")
```

## CLI

```bash
export X402_PRIVATE_KEY=0x...   # never pass this on a shared command line if you can avoid it
mt-transcribe meeting.mp3
mt-transcribe --format srt meeting.mp3 > meeting.srt
mt-transcribe --url https://example.com/episode.mp3
mt-transcribe --quote meeting.mp3    # HTTP 402 only; no key required
```

## Drop-in names (dTelecom file transcription)

`create_file_transcription`, `get_file_transcription`, and `delete_file_transcription` match the public file-transcription surface of `@dtelecom/x402-client` / the dTelecom gateway (snake_case). There is no `buy_credits` — pay the 402 per file instead.

Migration notes: https://speech.moneytools.dev/migrate/dtelecom

Hosted raw examples (also not prepaid):

- https://speech.moneytools.dev/examples/transcribe.py
- https://speech.moneytools.dev/examples/x402_sign.py
- https://speech.moneytools.dev/examples/transcribe.ts

## License

MIT

## One line, no code: call MoneyTools with AgentCash

[AgentCash](https://github.com/Merit-Systems/agentcash) (`npx agentcash`) pays from your own AgentCash wallet (USDC on Base, `~/.agentcash/wallet.json`). No MoneyTools account. Failed calls are not charged.

```bash
# Wallet Risk Card, 0.02 USDC
npx agentcash fetch "https://tools.moneytools.dev/v1/wallet-risk?address=vitalik.eth&chain=base"
# Pay precheck before paying any x402 seller, 0.005 USDC (free daily tier first)
npx agentcash fetch "https://api.moneytools.dev/v1/precheck?url=https://example.com/paid&method=GET"
# See the price and input schema first, without paying
npx agentcash check "https://tools.moneytools.dev/v1/wallet-risk"
```
