{
  "title": "WAV to MP3",
  "human_url": "https://happytails.ai/en/api/tools/wav-to-mp3/",
  "agent_url": "https://happytails.ai/agents/en/api/tools/wav-to-mp3/",
  "language": "en",
  "markdown_url": "https://happytails.ai/en/api/tools/wav-to-mp3.md",
  "content": "API reference\nWAV to MP3\nConvert WAV files to MP3 with the available format settings.\nPOST\n/api/v1/tools/wav-to-mp3/run\nBase URL: https://happytails.ai\n· public API not connected\nOverview\nBrowser processing keeps files on this device. Choosing Local server sends files to this website’s own processor. Audio is processed locally with FFmpeg. Lossy conversion does not recover lost detail.\nAll API requests process supplied data on the server.\nFile handling and privacy\n.\nRequest parameters\nSend a JSON object. Unknown properties are rejected. Omitted options use the defaults below; enter numbers and booleans as JSON values, not quoted text.\nNo text input is needed. Use the settings and files below.\nFiles\nAccepted formats:\n.mp3,.wav,.m4a,.aac,.flac,.ogg,.opus\n. Up to 1 file(s), totaling 20 MiB decoded.\nEach\nfiles\nentry requires\nname\nand padded\nbase64\n. Optional\nmime\ndescribes the content; optional\nbytes\nmust equal its decoded length. Filenames cannot contain paths. File URLs are not accepted. See\nuploading and saving files\n.\nOptions\noptions.bitrate\nstring\nMP3 bitrate (kbps)\nDefault:\n\"128\"\n· Allowed:\n64\n,\n96\n,\n128\n,\n192\n,\n256\n,\n320\noptions.engine\nstring\nProcessing location\nDefault:\n\"browser\"\n· Allowed:\nbrowser\n,\nserver\nSuccess response\nHTTP 200 returns\ntool\nand\nresult\n. Text is in\nresult.text\n; parsed JSON may also appear in\nresult.data\n. Generated files are in\nresult.files\nwith\nname\n,\nmime\n,\nbytes\nand\nbase64\n. Decode the bytes before saving. Empty file arrays and null text are valid for operations returning another result type.\nComplete output schema\n{\n\"type\": \"object\",\n\"required\": [\n\"tool\",\n\"result\"\n],\n\"properties\": {\n\"tool\": {\n\"type\": \"string\"\n},\n\"result\": {\n\"type\": \"object\",\n\"required\": [\n\"text\",\n\"files\"\n],\n\"properties\": {\n\"text\": {\n\"type\": [\n\"string\",\n\"null\"\n]\n},\n\"data\": {\n\"description\": \"Parsed JSON when the textual result is JSON.\"\n},\n\"name\": {\n\"type\": \"string\"\n},\n\"mime\": {\n\"type\": \"string\"\n},\n\"files\": {\n\"type\": \"array\",\n\"items\": {\n\"type\": \"object\",\n\"required\": [\n\"name\",\n\"mime\",\n\"bytes\",\n\"base64\"\n],\n\"properties\": {\n\"name\": {\n\"type\": \"string\"\n},\n\"mime\": {\n\"type\": \"string\"\n},\n\"bytes\": {\n\"type\": \"integer\"\n},\n\"base64\": {\n\"type\": \"string\",\n\"contentEncoding\": \"base64\"\n}\n}\n}\n}\n}\n}\n}\n}\nLimits and failures\nLimits below are enforced by this endpoint. Additional format, page, duration and model limits in the behavior notes also apply. Browser UI limits can differ from API limits.\nrequest_bytes\n31457280\ninput_characters\n1000000\nfiles_bytes\n20971520\nmax_files\n1\ntimeout_seconds\n90\nInvalid requests return an\nerror\nobject with\ncode\nand\nmessage\n. Read\nHTTP statuses, retries, timeouts and concurrency\n. Execution is synchronous and results are returned in the response.\nComplete request schema\nExpand the JSON schema\n{\n\"type\": \"object\",\n\"additionalProperties\": false,\n\"properties\": {\n\"input\": {\n\"type\": \"string\",\n\"maxLength\": 1000000,\n\"default\": \"\",\n\"description\": \"Plain text input. File tools use files instead unless otherwise documented.\"\n},\n\"options\": {\n\"type\": \"object\",\n\"additionalProperties\": false,\n\"properties\": {\n\"bitrate\": {\n\"type\": \"string\",\n\"description\": \"MP3 bitrate (kbps)\",\n\"default\": \"128\",\n\"enum\": [\n\"64\",\n\"96\",\n\"128\",\n\"192\",\n\"256\",\n\"320\"\n]\n},\n\"engine\": {\n\"type\": \"string\",\n\"description\": \"Processing location\",\n\"default\": \"browser\",\n\"enum\": [\n\"browser\",\n\"server\"\n]\n}\n}\n},\n\"files\": {\n\"type\": \"array\",\n\"maxItems\": 1,\n\"items\": {\n\"type\": \"object\",\n\"required\": [\n\"name\",\n\"base64\"\n],\n\"additionalProperties\": false,\n\"properties\": {\n\"name\": {\n\"type\": \"string\",\n\"maxLength\": 200,\n\"description\": \"Filename only, no path.\"\n},\n\"mime\": {\n\"type\": \"string\",\n\"maxLength\": 150\n},\n\"bytes\": {\n\"type\": \"integer\",\n\"minimum\": 0,\n\"description\": \"Optional decoded byte count; must match content if supplied.\"\n},\n\"base64\": {\n\"type\": \"string\",\n\"contentEncoding\": \"base64\",\n\"description\": \"File bytes as padded base64. Use the tool-specific limits.files_bytes value for the total decoded input size.\"\n}\n}\n}\n}\n}\n}\nFor browser automation, use the central\nWebMCP guidance\nand discover the tools actually exposed by the browser.\nRequest example\nPython\nimport json\nfrom urllib.request import Request, urlopen\nimport base64\nfrom pathlib import Path\nsource = Path(\"input.mp3\")\npayload = json.loads('{\"options\": {\"bitrate\": \"128\", \"engine\": \"browser\"}}')\npayload[\"files\"] = [{\n\"name\": source.name,\n\"base64\": base64.b64encode(source.read_bytes()).decode(\"ascii\")\n}]\nrequest = Request(\n\"https://happytails.ai/api/v1/tools/wav-to-mp3/run\",\ndata=json.dumps(payload).encode(),\nheaders={\"Content-Type\": \"application/json\"},\n)\nwith urlopen(request, timeout=200) as response:\nresult = json.load(response)\nprint(result)\nJavaScript\nimport { readFile } from \"node:fs/promises\";\nconst filename = \"input.mp3\";\nconst payload = {\n\"options\": {\n\"bitrate\": \"128\",\n\"engine\": \"browser\"\n}\n};\npayload.files = [{\nname: filename,\nbase64: (await readFile(filename)).toString(\"base64\")\n}];\nconst response = await fetch(\n\"https://happytails.ai/api/v1/tools/wav-to-mp3/run\",\n{\nmethod: \"POST\",\nheaders: { \"Content-Type\": \"application/json\" },\nbody: JSON.stringify(payload)\n}\n);\nconst data = await response.json();\nif (!response.ok) throw new Error(data.error.message);\nconsole.log(data.result);\ncURL\n# Save the JSON body as request.json first.\ncurl https://happytails.ai/api/v1/tools/wav-to-mp3/run \\\n-H \"Content-Type: application/json\" \\\n--data-binary @request.json\nJSON\n{\n\"options\": {\n\"bitrate\": \"128\",\n\"engine\": \"browser\"\n},\n\"files\": [\n{\n\"name\": \"input.mp3\",\n\"base64\": \"BASE64_FILE_BYTES\"\n}\n]\n}\nPython and JavaScript read your local file and encode it as Base64. Replace the input filename and API origin.\n200 OK · response structure\nJSON\n{\n\"tool\": \"wav-to-mp3\",\n\"result\": {\n\"text\": null,\n\"files\": [\n{\n\"name\": \"result\",\n\"mime\": \"application/octet-stream\",\n\"bytes\": 0,\n\"base64\": \"BASE64_OUTPUT_BYTES\"\n}\n]\n}\n}\nIllustrative envelope. Actual text, filename, MIME type and bytes depend on the result. See the complete output schema.\n400 Bad Request\nJSON\n{\n\"error\": {\n\"code\": \"INVALID_INPUT\",\n\"message\": \"Unknown request property. See the tool input schema.\"\n}\n}",
  "content_format": "text/plain",
  "visibility": "public",
  "links": [
    {
      "name": "File handling and privacy",
      "url": "https://happytails.ai/en/api/#files"
    },
    {
      "name": "HTTP statuses, retries, timeouts and concurrency",
      "url": "https://happytails.ai/en/api/#limits"
    },
    {
      "name": "WebMCP guidance",
      "url": "https://happytails.ai/en/api/#browser-agents"
    }
  ],
  "markdown": "# WAV to MP3\n\n- Human page: https://happytails.ai/en/api/tools/wav-to-mp3/\n- Markdown: https://happytails.ai/en/api/tools/wav-to-mp3.md\n- Structured JSON: https://happytails.ai/agents/en/api/tools/wav-to-mp3/index.json\n- Visibility: public\n\n## Page guide\n\nAPI reference\n\nConvert WAV files to MP3 with the available format settings.\n\nPOST\n\n/api/v1/tools/wav-to-mp3/run\n\nBase URL: https://happytails.ai · public API not connected\n\n## Overview\n\nBrowser processing keeps files on this device. Choosing Local server sends files to this website’s own processor. Audio is processed locally with FFmpeg. Lossy conversion does not recover lost detail.\n\nAll API requests process supplied data on the server. [File handling and privacy](https://happytails.ai/en/api/#files).\n\n## Request parameters\n\nSend a JSON object. Unknown properties are rejected. Omitted options use the defaults below; enter numbers and booleans as JSON values, not quoted text.\n\nNo text input is needed. Use the settings and files below.\n\n### Files\n\nAccepted formats: `.mp3,.wav,.m4a,.aac,.flac,.ogg,.opus`. Up to 1 file(s), totaling 20 MiB decoded.\n\nEach `files` entry requires `name` and padded `base64`. Optional `mime` describes the content; optional `bytes` must equal its decoded length. Filenames cannot contain paths. File URLs are not accepted. See [uploading and saving files](https://happytails.ai/en/api/#files).\n\n### Options\n\n#### `options.bitrate`\n\nType: string\n\nMP3 bitrate (kbps)\n\nDefault: `\"128\"` · Allowed: `64`, `96`, `128`, `192`, `256`, `320`\n\n#### `options.engine`\n\nType: string\n\nProcessing location\n\nDefault: `\"browser\"` · Allowed: `browser`, `server`\n\n## Success response\n\nHTTP 200 returns `tool` and `result`. Text is in `result.text`; parsed JSON may also appear in `result.data`. Generated files are in `result.files` with `name`, `mime`, `bytes` and `base64`. Decode the bytes before saving. Empty file arrays and null text are valid for operations returning another result type.\n\n### Complete output schema\n\n```json\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"tool\",\n    \"result\"\n  ],\n  \"properties\": {\n    \"tool\": {\n      \"type\": \"string\"\n    },\n    \"result\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"text\",\n        \"files\"\n      ],\n      \"properties\": {\n        \"text\": {\n          \"type\": [\n            \"string\",\n            \"null\"\n          ]\n        },\n        \"data\": {\n          \"description\": \"Parsed JSON when the textual result is JSON.\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"mime\": {\n          \"type\": \"string\"\n        },\n        \"files\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"object\",\n            \"required\": [\n              \"name\",\n              \"mime\",\n              \"bytes\",\n              \"base64\"\n            ],\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"mime\": {\n                \"type\": \"string\"\n              },\n              \"bytes\": {\n                \"type\": \"integer\"\n              },\n              \"base64\": {\n                \"type\": \"string\",\n                \"contentEncoding\": \"base64\"\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Limits and failures\n\nLimits below are enforced by this endpoint. Additional format, page, duration and model limits in the behavior notes also apply. Browser UI limits can differ from API limits.\n\n| Field | Value |\n| --- | --- |\n| `request_bytes` | 31457280 |\n| `input_characters` | 1000000 |\n| `files_bytes` | 20971520 |\n| `max_files` | 1 |\n| `timeout_seconds` | 90 |\n\nInvalid requests return an `error` object with `code` and `message`. Read [HTTP statuses, retries, timeouts and concurrency](https://happytails.ai/en/api/#limits). Execution is synchronous and results are returned in the response.\n\n## Complete request schema\n\n### Expand the JSON schema\n\n```json\n{\n  \"type\": \"object\",\n  \"additionalProperties\": false,\n  \"properties\": {\n    \"input\": {\n      \"type\": \"string\",\n      \"maxLength\": 1000000,\n      \"default\": \"\",\n      \"description\": \"Plain text input. File tools use files instead unless otherwise documented.\"\n    },\n    \"options\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"bitrate\": {\n          \"type\": \"string\",\n          \"description\": \"MP3 bitrate (kbps)\",\n          \"default\": \"128\",\n          \"enum\": [\n            \"64\",\n            \"96\",\n            \"128\",\n            \"192\",\n            \"256\",\n            \"320\"\n          ]\n        },\n        \"engine\": {\n          \"type\": \"string\",\n          \"description\": \"Processing location\",\n          \"default\": \"browser\",\n          \"enum\": [\n            \"browser\",\n            \"server\"\n          ]\n        }\n      }\n    },\n    \"files\": {\n      \"type\": \"array\",\n      \"maxItems\": 1,\n      \"items\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\",\n          \"base64\"\n        ],\n        \"additionalProperties\": false,\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\",\n            \"maxLength\": 200,\n            \"description\": \"Filename only, no path.\"\n          },\n          \"mime\": {\n            \"type\": \"string\",\n            \"maxLength\": 150\n          },\n          \"bytes\": {\n            \"type\": \"integer\",\n            \"minimum\": 0,\n            \"description\": \"Optional decoded byte count; must match content if supplied.\"\n          },\n          \"base64\": {\n            \"type\": \"string\",\n            \"contentEncoding\": \"base64\",\n            \"description\": \"File bytes as padded base64. Use the tool-specific limits.files_bytes value for the total decoded input size.\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nFor browser automation, use the central [WebMCP guidance](https://happytails.ai/en/api/#browser-agents) and discover the tools actually exposed by the browser.\n\nRequest example\n\n### Python\n\n```python\nimport json\nfrom urllib.request import Request, urlopen\nimport base64\nfrom pathlib import Path\n\nsource = Path(\"input.mp3\")\n\npayload = json.loads('{\"options\": {\"bitrate\": \"128\", \"engine\": \"browser\"}}')\npayload[\"files\"] = [{\n    \"name\": source.name,\n    \"base64\": base64.b64encode(source.read_bytes()).decode(\"ascii\")\n}]\n\nrequest = Request(\n    \"https://happytails.ai/api/v1/tools/wav-to-mp3/run\",\n    data=json.dumps(payload).encode(),\n    headers={\"Content-Type\": \"application/json\"},\n)\nwith urlopen(request, timeout=200) as response:\n    result = json.load(response)\n    print(result)\n```\n\n### JavaScript\n\n```javascript\nimport { readFile } from \"node:fs/promises\";\n\nconst filename = \"input.mp3\";\nconst payload = {\n  \"options\": {\n    \"bitrate\": \"128\",\n    \"engine\": \"browser\"\n  }\n};\npayload.files = [{\n  name: filename,\n  base64: (await readFile(filename)).toString(\"base64\")\n}];\n\nconst response = await fetch(\n  \"https://happytails.ai/api/v1/tools/wav-to-mp3/run\",\n  {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify(payload)\n  }\n);\nconst data = await response.json();\nif (!response.ok) throw new Error(data.error.message);\nconsole.log(data.result);\n```\n\n### cURL\n\n```bash\n# Save the JSON body as request.json first.\ncurl https://happytails.ai/api/v1/tools/wav-to-mp3/run \\\n  -H \"Content-Type: application/json\" \\\n  --data-binary @request.json\n```\n\n### JSON\n\n```json\n{\n  \"options\": {\n    \"bitrate\": \"128\",\n    \"engine\": \"browser\"\n  },\n  \"files\": [\n    {\n      \"name\": \"input.mp3\",\n      \"base64\": \"BASE64_FILE_BYTES\"\n    }\n  ]\n}\n```\n\nPython and JavaScript read your local file and encode it as Base64. Replace the input filename and API origin.\n\n200 OK · response structure\n\n### JSON\n\n```json\n{\n  \"tool\": \"wav-to-mp3\",\n  \"result\": {\n    \"text\": null,\n    \"files\": [\n      {\n        \"name\": \"result\",\n        \"mime\": \"application/octet-stream\",\n        \"bytes\": 0,\n        \"base64\": \"BASE64_OUTPUT_BYTES\"\n      }\n    ]\n  }\n}\n```\n\nIllustrative envelope. Actual text, filename, MIME type and bytes depend on the result. See the complete output schema.\n\n400 Bad Request\n\n### JSON\n\n```json\n{\n  \"error\": {\n    \"code\": \"INVALID_INPUT\",\n    \"message\": \"Unknown request property. See the tool input schema.\"\n  }\n}\n```\n"
}