Skip to content

feat(tts): add Audexum TTS provider tool - #836

Open
pepikir wants to merge 3 commits into
OpenMontageInc:mainfrom
pepikir:add-audexum-provider
Open

pepikir wants to merge 3 commits into
OpenMontageInc:mainfrom
pepikir:add-audexum-provider

Conversation

@pepikir

@pepikir pepikir commented Oct 22, 2026

Copy link
Copy Markdown

Adds audexum_tts, a TTS provider tool next to elevenlabs_tts / fish_audio_tts.

Disclosure: I work on Audexum (https://audexum.com), a TTS/STT API.

What it does

  • New tools/audio/audexum_tts.py, same BaseTool shape as elevenlabs_tts. It calls Audexum's ElevenLabs-compatible route POST /v1/text-to-speech/{voice_id} with xi-api-key, using requests (already used by the other tools). No new dependency.
  • Gated on AUDEXUM_API_KEY; optional AUDEXUM_BASE_URL.
  • Inputs: text (max 5000 chars), voice_id (default Nova), language_code, output_format (mp3_44100_128 or wav), output_path. Voice cloning, SSML and timestamps are not supported and the tool does not claim them.
  • estimate_cost is not overridden (returns the base 0.0), because I did not want to hard-code a price in the repo. The docs link to the pricing page.
  • tts_selector discovers it through the registry; nothing to wire.

Free tier: 2,000 credits at signup, then 250/day, no card. Roughly 1 credit per character on standard voices, 2 on V3 voices.

Other files: .env.example, docs/PROVIDERS.md (section, key table, capability table), provider set in tests/contracts/test_phase3_contracts.py, new tests/tools/test_audexum_tts.py (7 tests: key gating, request shape, text limits, HTTP error).

Tests: pytest tests/tools/test_audexum_tts.py tests/tools/test_fish_audio_tts.py tests/contracts/test_phase3_contracts.py gives 113 passed; the 12 TestVeoVideo failures also fail on a clean main in my environment (missing Google dependency). HTTP is mocked; I have not generated a full video with it.

Live check (2026-10-22): the endpoint used here returns audio for every voice listed above.

@pepikir
pepikir requested a review from calesthio as a code owner October 22, 2026 10:10

@calesthio calesthio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing the Audexum integration. I reviewed the provider, tests and setup guidance against docs/PR_REVIEW_GUIDE.md; the seven focused mocked tests pass. Two contracts need correction before approval.

[P1] Do not report paid synthesis as free. AudexumTTS has no estimate_cost override, so 5,000 characters return 0.0 from BaseTool.estimate_cost, and successful results also default to zero cost. Audexum's API reference documents per-character tier multipliers, and its plans include paid usage. This bypasses budget/approval decisions and understates actual spend. Implement a documented estimate or raise PriceQuoteRequired; report unpriced charges as unknown, rather than zero. Add budget-facing coverage.

[P1] Validate the actual public API contract. The adapter sends xi-api-key to /v1/text-to-speech/{voice_id} with language_code and an output_format query. The current maintained reference instead documents Bearer authentication and POST /api/synthesize with voice, lang and format. Please adapt to that contract, or provide maintained documentation and transport fixtures for the claimed ElevenLabs-compatible route. The supplied mocks only assert the adapter's own assumptions, so they cannot establish compatibility.

No real synthesis or paid API call was made. Please also rebase against current main and run the provider/selector contract suites after these corrections.

pepikir and others added 2 commits November 8, 2026 10:30
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review of OpenMontageInc#836 found two contract problems:

- Paid synthesis reported as free. estimate_cost now raises
  PriceQuoteRequired naming the exact credit count (1 / 1.5 / 2 credits per
  character on v1 / v2 / v3, per audexum.com/help/credits/how-credits-work);
  the EUR price of a credit depends on the account's plan or pack, so
  results carry cost_usd=None, cost_status "unquoted" and estimated_credits,
  following mai_tts and the eleven_v4 path in elevenlabs_tts.
- Undocumented transport. The adapter now calls the documented
  POST /api/synthesize with Bearer auth and body fields text, voice, lang,
  format and backend (audexum.com/docs), instead of the ElevenLabs-style
  route.

Also: engine input (v1/v2/v3, inferred from the voice), language region
suffixes dropped (en-US -> en), output_format mapped by prefix with
unsupported formats rejected before any request, correct file extension,
output_schema, docs and .env.example updated, tests for the request
contract, budget behaviour (dry_run, scoring) and selector routing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01No5BjeaLzSDP4LhEthEGit
@pepikir
pepikir force-pushed the add-audexum-provider branch from d072b27 to 21f4952 Compare November 8, 2026 10:08
@pepikir

pepikir commented Nov 8, 2026

Copy link
Copy Markdown
Author

Thanks for the careful review. Both P1s are addressed in 21f4952, on top of a rebase onto current main.

Cost. estimate_cost now raises PriceQuoteRequired with the exact credit count (1 / 1.5 / 2 credits per character on v1 / v2 / v3, per https://audexum.com/help/credits/how-credits-work); credits are sold through EUR plans and packs the tool cannot see, so dry_run reports quote_required, and results carry cost_usd: None, cost_status: "unquoted" and estimated_credits, following mai_tts and the eleven_v4 path. Tests cover estimate_cost, dry_run, the result and lib.scoring (unknown cost, no crash).

Contract. The adapter now calls the documented POST /api/synthesize with Authorization: Bearer and body text, voice, lang, format, backend (https://audexum.com/docs); no ElevenLabs route. The fixtures assert that exact body, including a TTSSelector routing test (en-US -> lang: "en", mp3_44100_128 -> format: "mp3"). Docs and .env.example updated.

Ran: tests/tools/test_audexum_tts.py, tests/contracts/test_phase3_contracts.py, test_env_example.py, test_preflight_capability_coverage.py, selector/provider suites (226 passed); full tests/contracts + tests/tools: 2669 passed, 1 local-environment failure in test_bmts_lite.py (expects a python executable; this machine only has python3), unrelated to this PR.

# Conflicts:
#	docs/PROVIDERS.md
@pepikir

pepikir commented Nov 14, 2026

Copy link
Copy Markdown
Author

@calesthio friendly ping: both P1s from your review are addressed (cost is now reported as unquoted rather than 0, and the adapter uses the documented POST /api/synthesize contract with Bearer auth; details in my comment above). I've merged current main so the branch is conflict-free again; tests/tools/test_audexum_tts.py plus the contract suites pass locally (1547 passed, 9 skipped). Happy to change anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants