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 takes simple keyword queries plus tag, category and duration filters, which makes it a good fit 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:

ToolDescriptionEndpoint
search_soundsSearch sounds by query, category, tags, or durationGET /api/v1/sounds
get_soundGet full metadata for a soundGET /api/v1/sounds/{id}
download_soundGet a signed download URLGET /api/v1/sounds/{id}/download
browse_samplesGet 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": "Short keywords, e.g. 'rain'. Each word must match a sound name, description or tag"
      },
      "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 keyword search with tag, category and duration filters.",
  "input_schema": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "description": "Keywords. Each word must match a sound name, description or tag"
      },
      "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=sfx for sound effects, category=music for music tracks, category=lofi for lo-fi beats, category=ambient for ambience. Ideal for building tabbed UIs.
  • Use short keywords - Each word in q must match the name, description or a tag. "chime" finds more than "gentle notification chime". Add tags or max_duration to narrow results.
  • Combine query + category + tags - q=gentle&category=ambient&tags=rain gives precise results.
  • Filter by duration - Use max_duration=3 for short UI sounds, min_duration=30 for ambient loops.
  • Download URLs expire - They last 1 hour. Only generate them when the user is ready.
  • Start with samples - The /sample endpoint 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.

On this page