# LyricPatch: no-install agent quickstart

Canonical instructions: https://lyricpatch.com/agents/quickstart.md
Standalone helper: https://lyricpatch.com/agent/lyricpatch.py
Live offer: https://api.lyricpatch.com/v1/agent/sessions/offer
API schema: https://api.lyricpatch.com/v1/agent/openapi.json
Full reference: https://lyricpatch.com/agents/docs

Use direct HTTPS with the downloadable standard-library Python helper. No plugin,
pip package, LyricPatch website account, crypto wallet or manually pasted API key
is required. MCP and the installed CLI are optional alternatives. The guest API
does not use human website sign-in or CAPTCHA. Do not automate sign-in or bypass
a host's network/security restrictions.

## Check capabilities before payment

This recipe is capability-based, not a claim of a verified live test in ChatGPT
Work or every host. Check actual outbound HTTPS to this site/API and returned
signed storage URLs; Python execution; access to the authorized MP3; private file
persistence across turns/payment; and ability to return/play downloaded audio.
Public-page browsing alone is insufficient. If a capability is missing, explain
the precise limitation. If the host has browser interaction but not direct HTTP,
try the normal guest workspace at https://lyricpatch.com/agents/workspace; do not
bypass host restrictions. Stop before payment if neither route can complete the
workflow. Do not ask for pasted keys.

## Confirm the edit and missing permissions together

Get the exact original/replacement words, approved start/end seconds and total
credit ceiling including export. Selections must be 0.1–6 seconds. Unknown timing:
ask the person, or use an independently authorized word-timed transcript with the
API's local phrase matcher and confirm the candidate. Never silently choose among
multiple matches. Do not send the whole song to OpenAI transcription to locate a
phrase. Optional LyricPatch transcription covers only an already-selected clip.

Read the live offer for current price, credits, legal_version and linked terms.
Policies: https://lyricpatch.com/legal/terms,
https://lyricpatch.com/legal/acceptable-use, https://lyricpatch.com/legal/privacy.
Bundle missing permissions into ONE concise confirmation: actual age 18+, current
terms, recording/lyrics/voice rights, external media processing, displayed purchase
and authorized edit/export scope with a total credit ceiling. Never infer consent
from example flags or an upload. Reuse explicit authorization already given; do
not ask the same question again. A ceiling alone is not authorization to spend.
Quotes must remain within the authorized scope/ceiling; changed cost or scope needs
approval. Buying credits alone does not approve generation/export/publication.

## Download and inspect; no installation

Download https://lyricpatch.com/agent/lyricpatch.py to a local file, inspect it,
then execute that saved file. Never pipe remote code into a shell/interpreter.
For example, downloading only:

```python
from urllib.request import urlretrieve
urlretrieve("https://lyricpatch.com/agent/lyricpatch.py", "lyricpatch.py")
```

Use an owner-only private working directory that survives the payment pause,
outside repositories, synced/shared folders and user-deliverable output directories.
Python's `tempfile.mkdtemp` can create a fresh directory on a private filesystem.
Replace `./private` below with its path. Save exact approved words to private
UTF-8 `original.txt` and `replacement.txt`. Keep one private `run.json` for all
stages. It contains credentials, edit intent, budget and recovery identifiers:
never print, log, attach or paste state into chat. The helper creates/retrieves its
own credentials after verified funding; no manual key step. There is no email
recovery for lost session access. Return only preview and finished audio files.

## Complete recipe: intent → Stripe → same-state resume → preview → export

The example uses known 44–48-second timing and a 9-credit total ceiling; substitute
the person's approved files, timing and budget. This is not automatic phrase
discovery or spending permission. Run stages separately, respecting user decisions.

```sh
# Read current price, credits and legal version; no spending.
python lyricpatch.py offer

# Only with actual rights/media consent: persist intent before checkout.
# Without funded access this pauses for funding; it does not buy or generate.
python lyricpatch.py preview --state ./private/run.json --song song.mp3 --original-file ./private/original.txt --replacement-file ./private/replacement.txt --start 44 --end 48 --max-credits 9 --format mp3 --output preview.wav --rights-confirmed --allow-media-processing

# Only with actual purchase/attestation authorization. Replace CURRENT_FROM_OFFER.
# If the live $1.99 offer has changed, stop and explain the mismatch.
python lyricpatch.py connect --state ./private/run.json --authorize-1-99-checkout --adult --accept-terms --rights-confirmed --allow-media-processing --legal-version CURRENT_FROM_OFFER
```

Show the returned Stripe `checkout_url` as a clickable link with live price/credits.
If the host suppresses the hyperlink, also provide that exact SAME checkout URL
as copyable plain text. Recover/reuse the existing URL from the same private state;
do not recreate checkout to fix link rendering. Expose only the payment URL, never
session credentials, API keys or private state.
The person pays in Stripe and returns to the SAME task saying **Paid—continue.**
Never ask for card details in chat or pay automatically. No automatic wake-up is
promised. The statement and redirect do not prove payment; verify the SAME session:

```sh
# Read/recover only; server verifies funding, never trust a redirect or "Paid".
python lyricpatch.py status --state ./private/run.json

# Only after funded access: upload, prepare and quote; no generation charge.
python lyricpatch.py preview --state ./private/run.json --output preview.wav

# Only when the returned quote is expressly authorized and within saved scope/budget.
python lyricpatch.py preview --state ./private/run.json --output preview.wav --authorize-generation
```

Present the quote and use existing explicit authorization if it covers that quote;
otherwise ask. A changed/expired quote needs review and renewed approval when not
covered. Play or attach `preview.wav`. Keep preview/version approval unless the
person explicitly delegated first-version selection. Successful alternates cost
credits again; never create them without authorization.

```sh
# Select only the approved version and quote export; no export charge yet.
python lyricpatch.py export --state ./private/run.json --output edited.mp3 --approve-version

# Only when the export quote is expressly authorized within the saved total ceiling.
python lyricpatch.py export --state ./private/run.json --output edited.mp3 --approve-version --authorize-export
```

Return actual `edited.mp3`, not a signed URL or private state. For WAV set
`--format wav` on the FIRST intent command and use `edited.wav` later; keep the
saved format on retries. Download before the project's 24-hour expiry.

## Recovery and boundaries

- `work_pending`: rerun the same stage and state; preserve job/quote/idempotency IDs.
- Payment pending: wait at least five seconds between checks of the SAME session.
  Do not create another checkout, switch to a wallet or restart a generation.
- Lost state or a timeout is NOT permission to buy again or repeat potentially
  successful work. Explain the loss and stop. Preserve state through payment.
- Stop for expired projects, revoked/restricted access, changed intent/consent,
  exhausted budgets or unresolved payment. Never bypass these safeguards.
- The total credit ceiling includes export; it is not permission for another pack.
- `X-LyricPatch-Session` goes only to API bootstrap/status. The recovered bearer
  key goes only to the API; never forward credentials to storage URLs or Stripe.
- Never publish audio, run hidden alternates, or transcribe the whole song.

## Copyable request

> Use https://lyricpatch.com/agents/quickstart.md for my attached MP3 through direct
> HTTPS, without plugin/package installation, a LyricPatch account or pasted keys.
> Original: [words]. Replacement: [words]. Timing: [seconds, or ask me]. Total
> credit ceiling including export: [credits]. Check network, Python and private
> persistent files first. Read the live offer/terms and ask for any missing age,
> rights, media-processing and purchase/edit permissions in one confirmation.
> Save private state, give me the Stripe link, and resume the SAME state when I
> return. Verify payment through the API, quote within my explicit authorization,
> let me hear the preview and approve its version before export. Return the audio,
> never credentials/state. Ask about unknown timing; no whole-song transcription.

Optional CLI/MCP: https://lyricpatch.com/agents/integrations#workflow
