langchain-tunova
LangChain integration for Tunova — an API that turns a text prompt into a complete, ready-to-listen song. This package gives your LangChain agents a music generation tool.
Agent-friendly billing: songs are billed only on successful renders — failed generations auto-refund, so autonomous retries are safe. 10 tokens per song, and every account starts with 50 free tokens (no card required).
Installation
pip install langchain-tunova
Setup
Get an API key at tunova.ai and export it:
export TUNOVA_API_KEY="your-api-key"
(Or pass api_key="..." to the tool constructor.)
Usage
Direct invocation:
from langchain_tunova import TunovaMusicGenerationTool
tool = TunovaMusicGenerationTool()
print(tool.invoke({"prompt": "an upbeat synthwave track about road trips"}))
# Generated "Neon Highway" (192s): https://cdn.tunova.ai/...mp3
With an agent:
from langchain.agents import create_agent
from langchain_tunova import TunovaMusicGenerationTool
agent = create_agent(
model="claude-sonnet-4-5",
tools=[TunovaMusicGenerationTool()],
)
result = agent.invoke(
{"messages": [("user", "Make me a chill instrumental lofi track for studying.")]}
)
print(result["messages"][-1].content)
Generation takes a few minutes; the tool polls the job and returns the song title, duration, and audio URL. If a render fails, the tool tells the agent that the tokens were auto-refunded — so the agent can simply retry, at no cost.
Tool reference
| Tool name | tunova_generate_song |
| Arguments | prompt: str, make_instrumental: bool = False |
| Returns | Generated "<title>" (<duration>s): <audio_url> or an error string |
| Auth | TUNOVA_API_KEY env var or api_key= constructor arg |
| Async | Supported (await tool.ainvoke(...)) |
License
MIT © 2026 Tunova
Release files for langchain-tunova 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_tunova-0.1.0.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_tunova-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / langchain_tunova-0.1.0.tar.gz
| Download URL | langchain_tunova-0.1.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e96f67176d8058d3045ca2a5cbd474bca89a61e5b0d8914d498b3c2bb34a3523
|
|
BLAKE2b-256 checksum How to use checksums |
34e29e29edac9af7b6523b0fd7363217ca910131ad8040be9a0778ffffde67ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / langchain_tunova-0.1.0-py3-none-any.whl
| Download URL | langchain_tunova-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
331e830e00c42636988ecb9db467169c543792c3ff91e9bc28e40d8b14dcadab
|
|
BLAKE2b-256 checksum How to use checksums |
e71bf95701e660375824d7bbcf96db07e04041f175e019ecc54d7b15683b7155
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|