{"schema_version":"1.0","name":"OnChain Music","description":"A music licensing platform offering over 5,000 independently owned, fully cleared tracks. AI agents can search the catalog by genre, mood, tempo, BPM, instrumentation, and use type, then license tracks instantly with on-chain USDC payments on Base. No human in the loop.","url":"https:\/\/onchainmusic.com","documentation_url":"https:\/\/onchainmusic.com\/api-docs","contact":{"partnerships":"https:\/\/onchainmusic.com\/contact"},"capabilities":["search","retrieve","purchase","catalog_search","natural_language_search","track_metadata","license_purchase","x402_payments","on_chain_royalties"],"preferred_flow":["search","select_track","initiate_license","make_payment","verify_license","download"],"payment":{"protocol":"x402","networks":[{"chain":"base","chain_id":8453,"tokens":["USDC"],"status":"active","usdc_contract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},{"chain":"ethereum","chain_id":1,"tokens":["USDC","USDT"],"status":"planned"},{"chain":"solana","tokens":["USDC","USDT"],"status":"planned"}]},"license_types":[{"id":"social_media","name":"Social Media License","description":"Non-commercial use on TikTok, Instagram, YouTube, X, and similar platforms.","price_usdc":"5.00","term":"perpetual","exclusivity":"non-exclusive","territories":"worldwide","permitted_uses":["TikTok","Instagram","YouTube","X (Twitter)","Facebook","Social media platforms"]},{"id":"all_digital","name":"All Digital License","description":"Commercial use including advertising, apps, games, podcasts, websites, and all digital media.","price_usdc":"35.00","term":"perpetual","exclusivity":"non-exclusive","territories":"worldwide","permitted_uses":["Online advertising","Mobile apps","Video games","Podcasts","Websites","Streaming platforms","Digital media","Social media (commercial)"]}],"api":{"type":"openapi","url":"https:\/\/onchainmusic.com\/api\/docs\/openapi.json","base_url":"https:\/\/onchainmusic.com\/api\/v1\/agent","authentication":{"type":"none"},"flow":{"step_1":"Search catalog: GET \/api\/v1\/agent\/catalog\/search \u2014 or use POST \/api\/v1\/agent\/ai-search for natural language queries","step_2":"Get track detail: GET \/api\/v1\/agent\/catalog\/tracks\/{id}","step_3":"Initiate license: POST \/api\/v1\/agent\/license\/{track_id}\/{license_type} with body { \"paying_wallet\": \"0x...\" }","step_4":"Send USDC on Base from your paying_wallet to the address returned in the 402 response","step_5":"Poll for license: GET \/api\/v1\/agent\/license\/verify\/{payment_id}","step_6":"Receive signed license document and S3 download URLs"},"search_tips":{"primary_field":"Always use description= as the primary search field for style, mood, and energy queries. Pass descriptive words directly \u2014 the API searches each word individually across multiple fields.","example":"description=epic orchestral trailer","natural_language":"Use POST \/api\/v1\/agent\/ai-search with a plain English phrase for automatic parameter extraction.","avoid":"Do not use the mood= parameter \u2014 pass mood words in description= instead."},"endpoints":[{"path":"\/api\/v1\/agent\/catalog\/search","method":"GET","description":"Search the music catalog. Use description= as the primary search field for style and mood queries.","authentication":{"type":"none"},"payment_required":false,"parameters":{"description":"string \u2014 PRIMARY FIELD. Pass style, mood, energy, instrumentation, or use-case words. Each word is searched individually. Example: \"epic orchestral trailer\"","genre":"string \u2014 matches Category (e.g. \"Rock\", \"Hip Hop\", \"Orchestral\", \"Electronica\")","subgenre":"string \u2014 matches SubCategory","additional":"string \u2014 matches Additional_Categories","tempo":"string \u2014 e.g. \"Medium\", \"Fast\", \"Slow\"","bpm_min":"integer \u2014 minimum BPM","bpm_max":"integer \u2014 maximum BPM","key":"string \u2014 e.g. \"C Minor\", \"G Maj\"","instrumental":"string \u2014 Yes (no vocals) or No (has vocals)","keywords":"string \u2014 keyword search","license_type":"string \u2014 social_media | all_digital","per_page":"integer \u2014 results per page (max 50, default 20)","page":"integer \u2014 page number. Vary this for result variety."}},{"path":"\/api\/v1\/agent\/ai-search","method":"POST","description":"Natural language music search. Send a plain English phrase and the API uses GPT-4o-mini to translate it into structured search parameters automatically.","authentication":{"type":"none"},"payment_required":false,"body":{"phrase":"string \u2014 plain English music description. Example: \"I need an upbeat indie rock track for a TV commercial\"","per_page":"integer \u2014 results per page (default 10)"},"response_extras":{"ai.original_phrase":"The phrase you submitted","ai.translated_params":"The structured parameters extracted by GPT-4o-mini"}},{"path":"\/api\/v1\/agent\/catalog\/tracks\/{id}","method":"GET","description":"Retrieve full metadata for a specific track including license pricing and available formats.","authentication":{"type":"none"},"payment_required":false},{"path":"\/api\/v1\/agent\/license\/{track_id}\/{license_type}","method":"POST","description":"Initiate a license purchase. Provide your paying_wallet address in the request body. Returns 402 with payment instructions. Append ?mode=gpt for ChatGPT-compatible 200 response.","authentication":{"type":"none"},"payment_required":true,"payment_protocol":"x402","body":{"paying_wallet":"string \u2014 your wallet address on Base (0x...)"},"query_params":{"mode":"string \u2014 pass \"gpt\" to receive a 200 response instead of 402 (required for ChatGPT GPT compatibility)"},"license_types":{"social_media":"$5.00 USDC \u2014 TikTok, Instagram, YouTube, X, social platforms","all_digital":"$35.00 USDC \u2014 commercial advertising, apps, games, podcasts, websites"}},{"path":"\/api\/v1\/agent\/license\/verify\/{payment_id}","method":"GET","description":"Poll for license status. Returns 202 while awaiting payment, 200 with signed license document and download URLs once confirmed.","authentication":{"type":"none"},"payment_required":false,"poll_interval":"5 seconds","timeout":"5 minutes"}]},"responses":{"catalog_search":{"tracks":[{"id":"integer","title":"string","artists":"array \u2014 [{id, name}]","genre":"string","subgenre":"string","bpm":"integer","duration":"string","instrumental":"boolean","description":"string","preview_url":"string \u2014 links to OnChain Music track page","artwork_url":"string","formats_available":"object \u2014 {mp3, wav, aif}","license_purchase_url":"string"}],"meta":{"total":"integer","per_page":"integer","current_page":"integer","last_page":"integer","fallback":"boolean \u2014 true if filters were relaxed to return results"}}}}