使用 FoxAI v1模型

计费规则

一次请求,返回两首歌曲。不同模型价格不同:

  • 使用 foxai-v1 模型,每次扣费 1 points, 返回两首歌曲。

开始

注意: 使用 foxai-v1 模型,仅支持英文,且不支持 纯音乐(instrumental)。纯音乐请使用 suno。

Base URL: https://api.foxai.me/api/v1/music

headers 参数:

{
  "api-key": "Your API Key",
}

提交生成音乐任务

路径:/generate

方法:POST

类型:application/json

参数示例:

  1. 根据歌词和标签生成音乐
{
    "model": "foxai-v1",
    "tags": ["rock", "pop"],
    "lyrics" : """[Verse]
        Woke up today the sky was gray
        o sunshine no color play
        But in my heart there’s light to share
        I’ll dance in rain without a care

        [Verse 2]
        Puddles were made for us to splash
        No need to rush no need to dash
        Dancing free with lightning’s flash
        Embrace the moment make it last"""
}

  1. 根据描述生成音乐
{
    "model": "foxai-v1",
    "description": "The last song ever sung on the planet earth"
}

查询

路径:/query

方法:GET

支持多个 id 一起查询。 例如:

/query?ids=id1,id2,id3

返回结果示例:

[
  {
    "id": "9852c423-203e-4ae9-a616-cc5f8eda7fb3",
    "audio_url": "https://cdn.foxai.me/song_9852c423-203e-4ae9-a616-cc5f8eda7fb3.mp3",
    "image_url": "https://cdn.foxai.me/image_9852c423-203e-4ae9-a616-cc5f8eda7fb3.png",
    "video_url": "",
    "title": "Splashing in Stormy Serenades",
    "metadata": {
      "model": "foxai-v1",
      "lyrics": "[Verse]\n        Woke up today the sky was gray\n        o sunshine no color play\n        But in my heart there’s light to share\n        I’ll dance in rain without a care\n\n        [Verse 2]\n        Puddles were made for us to splash\n        No need to rush no need to dash\n        Dancing free with lightning’s flash\n        Embrace the moment make it last",
      "tags": [
        "rock",
        "pop"
      ],
      "duration": 30
    },
    "status": "success",
    "duration": 30,
    "err_msg": null,
    "created_at": "2024-11-28T13:36:05.382514"
  }
]