Skip to main content
POST
/
v1beta
/
models
/
{model}
:generateContent
curl --request POST \
  --url https://api.foxapi.cc/v1beta/models/{model}:generateContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Create a 30-second upbeat folk song using guitar and harmonica."
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "AUDIO",
      "TEXT"
    ]
  }
}
'
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "Here is an upbeat folk song featuring guitar and harmonica.",
            "inlineData": {
              "mimeType": "audio/mpeg",
              "data": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4..."
            }
          }
        ],
        "role": "model"
      },
      "finishReason": "STOP",
      "safetyRatings": [
        {
          "category": "<string>",
          "probability": "<string>"
        }
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 15,
    "candidatesTokenCount": 200,
    "totalTokenCount": 215
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

All endpoints require Bearer Token authentication

Add the following to your request headers:

Authorization: Bearer YOUR_API_KEY

Path Parameters

model
enum<string>
required

Model name. lyria-3-clip-preview generates 30-second clips (default MP3 / audio/mpeg). lyria-3-pro-preview generates full songs; you can request audio/mpeg or audio/wav, but the actual output format should be determined by the returned inlineData.mimeType

Available options:
lyria-3-clip-preview,
lyria-3-pro-preview
Example:

"lyria-3-clip-preview"

Body

application/json
contents
object[]
required

Content list. Music generation is a single-turn process; multi-turn iterative editing is not supported

generationConfig
object
required

Generation config; responseModalities must include AUDIO for music generation requests

systemInstruction
object

System instruction. Lyria 3 model support for this field is not confirmed by official documentation; it may not take effect

safetySettings
object[]

Content safety filter settings

Response

Music generation response

candidates
object[]

List of generation result candidates

usageMetadata
object

Token usage statistics