# Compacthost AI Music Generator

> Compacthost AI Music Generator is a paid API for AI agents from x402.compacthost.com, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Generates an MP3 audio track from a style/mood prompt and optional lyrics, paid per-call in USDC on Base via x402

## Facts

- Endpoint: POST https://x402.compacthost.com/music
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/compacthost-ai-music-generator-ca72f7ea
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vpTSs87tOLpmv4r4hZceQ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability compacthost-ai-music-generator-ca72f7ea -d '<json body>'
```

Example prompt: Generate a 45-second upbeat lo-fi hip-hop track with the lyrics 'morning light, coffee in hand, the city wakes up slow' — I want it to feel relaxed and jazzy.

## When to prefer this

Choose this endpoint when you need to generate a complete music audio file (MP3) on-demand from a text description, with optional lyrical content and a configurable duration — particularly in automated pipelines that can handle pay-per-call USDC micropayments via x402 on Base. It is well-suited for agents that need to produce background music, jingles, or ambient soundscapes without a subscription. Prefer it over text-to-speech endpoints when the output should be musical rather than spoken, and over video generation endpoints when only audio is needed.

## Known failure modes

- Invalid duration outside 15-240 second range returns an error
- Prompt or lyrics too long may be rejected or truncated
- Payment failure via x402 (insufficient USDC balance) results in 402 response and no audio
- Generation timeout for longer durations may result in no response
- Ambiguous or empty prompt may yield generic or low-quality output

## How this service works

Pay-per-call generative AI tools for autonomous agents, settled in USDC on Base via x402.

## Output

Returns a binary MP3 audio file (audio/mpeg) containing the AI-generated music track matching the requested style, mood, optional lyrics, and duration.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lyrics": {
   "type": "string",
   "description": "Optional song lyrics"
  },
  "prompt": {
   "type": "string",
   "description": "Style/mood description"
  },
  "duration": {
   "type": "number",
   "description": "Seconds, 15-240, default 60"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "audio/mpeg"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/compacthost-ai-music-generator-ca72f7ea/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.compacthost.com](https://www.zero.xyz/host/x402.compacthost.com/llms.txt)
