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:

ToolDescriptionEndpoint
search_soundsSearch sounds by query, 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": "Natural language search query, e.g. 'gentle rain on a rooftop'"
      },
      "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.",
  "input_schema": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "description": "Natural language search query"
      },
      "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, tags: str = None, limit: int = 5) -> dict:
    """Search Lotsofsounds for royalty-free sound effects."""
    params = {"q": query, "limit": limit}
    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

  • Use natural language — The q parameter searches name and description. "Gentle notification chime" works better than just "chime".
  • Combine query + tagsq=gentle&tags=notification,ui 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.

Get your API key

On this page