LLM & AI Agent Integration
How to use the Lotsofsounds API as a tool in LLM agents, chatbots, and AI workflows
Overview
The Lotsofsounds API is designed to work as a tool for LLMs and AI agents. The search endpoint supports natural language queries, making it ideal for function calling in frameworks like OpenAI, Claude, LangChain, and CrewAI.
LLMs.txt
We publish machine-readable documentation for LLMs at:
- /llms.txt — Quick reference with endpoints, auth, and tool-use tips
- /llms-full.txt — Full API reference with tool schemas, examples, and agent best practices
- /openapi.yaml — OpenAPI 3.1 spec for automated tool generation
Point your agent framework at these URLs to auto-configure Lotsofsounds as a tool.
Tool Definitions
Register these tools in your agent to give it audio capabilities:
| Tool | Description | Endpoint |
|---|---|---|
search_sounds | Search sounds by query, category, tags, or duration | GET /api/v1/sounds |
get_sound | Get full metadata for a sound | GET /api/v1/sounds/{id} |
download_sound | Get a signed download URL | GET /api/v1/sounds/{id}/download |
browse_samples | Get free sample sounds (no auth) | GET /api/v1/sounds/sample |
Example: OpenAI Function Calling
{
"name": "search_sounds",
"description": "Search the Lotsofsounds API for royalty-free sound effects and music",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Natural language search query, e.g. 'gentle rain on a rooftop'"
},
"category": {
"type": "string",
"enum": ["sfx", "music", "lofi", "ambient"],
"description": "Filter by category: sfx (sound effects), music, lofi, or ambient"
},
"tags": {
"type": "string",
"description": "Comma-separated tags to filter by, e.g. 'nature,rain'"
},
"max_duration": {
"type": "number",
"description": "Maximum sound duration in seconds"
},
"limit": {
"type": "integer",
"description": "Number of results to return (1-100, default 20)"
}
}
}
}Example: Claude Tool Use
{
"name": "search_sounds",
"description": "Search the Lotsofsounds API for royalty-free sound effects and music. Supports natural language queries and category filtering.",
"input_schema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Natural language search query"
},
"category": {
"type": "string",
"enum": ["sfx", "music", "lofi", "ambient"],
"description": "Filter by category: sfx, music, lofi, or ambient"
},
"tags": {
"type": "string",
"description": "Comma-separated tags to filter by (AND logic)"
},
"max_duration": {
"type": "number",
"description": "Maximum duration in seconds"
}
}
}
}Example: LangChain (Python)
import requests
def search_sounds(query: str, category: str = None, tags: str = None, limit: int = 5) -> dict:
"""Search Lotsofsounds for royalty-free sound effects."""
params = {"q": query, "limit": limit}
if category:
params["category"] = category
if tags:
params["tags"] = tags
response = requests.get(
"https://api.lotsofsounds.com/api/v1/sounds",
headers={"x-api-key": "los_your_key"},
params=params,
)
return response.json()Tips for Agents
- Filter by category — Use
category=sfxfor sound effects,category=musicfor music tracks,category=lofifor lo-fi beats,category=ambientfor ambience. Ideal for building tabbed UIs. - Use natural language — The
qparameter searches name and description. "Gentle notification chime" works better than just "chime". - Combine query + category + tags —
q=gentle&category=ambient&tags=raingives precise results. - Filter by duration — Use
max_duration=3for short UI sounds,min_duration=30for ambient loops. - Download URLs expire — They last 1 hour. Only generate them when the user is ready.
- Start with samples — The
/sampleendpoint needs no auth, perfect for demos. - All sounds are royalty-free — Safe to recommend for any project.
Available Tags
Tag filtering uses AND logic
When you pass multiple tags like tags=nature,rain, only sounds with both tags are returned.
Nature: nature, weather, thunder, rain, wind, ocean, forest, birds, water UI: ui, click, notification, transition Foley: foley, footsteps, door, keyboard, glass, camera, cork Music: music, piano, guitar, drums, synth, vinyl Cinematic: cinematic, boom, drone, laser Other: ambient, crowd, helicopter, subway, fireplace, cat, bell, chime, buzz, whoosh, swoosh
Ready to integrate?
Get your API key and start building with thousands of sound effects and music tracks.
Get your API key