Przejdź do treści
Dokumentacja API
Dokumentacja API

Suno Generuj personę

Użyj punktu końcowego generate persona, aby otrzymać wynik w tej samej odpowiedzi.

01

Omówienie

Użyj punktu końcowego generate persona i odczytaj wynik z tej samej odpowiedzi.

Szybki start

  1. Utwórz klucz API i ustaw go jako RUNAPI_API_KEY.
  2. Wyślij żądanie POST, którego treść odpowiada schematowi żądania.
  3. Odczytaj wynik z treści pomyślnej odpowiedzi.

Punkt końcowy

POST /api/v1/suno/generate_persona
Bazowy URL
https://runapi.ai
Wersja API
v1
Uwierzytelnianie
Authorization: Bearer YOUR_API_TOKEN
02

Obsługiwane modele

Otwórz stronę modelu, aby zapoznać się z aktualnymi cenami, limitami żądań i szczegółami dotyczącymi użytku komercyjnego.

03

Schemat żądania

Treść JSON

Wysyłaj wyłącznie pola zadeklarowane dla tego punktu końcowego.

Treść żądania4 pola
audio_idstring
Wymagane

ID audio w ramach zadania źródłowego.

descriptionstring
Wymagane

Opis persony.

namestring
Wymagane

Nazwa persony.

task_idstring
Wymagane

Identyfikator zadania źródłowego z referencyjnymi wokalizami.

04

Odpowiedź sukcesu

HTTP 200

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "persona": {
      "properties": {
        "description": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "description"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "persona",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "persona": {
    "description": "A warm and expressive vocal character.",
    "id": "persona_reference",
    "name": "Studio Voice"
  }
}
05

Błędy

HTTP 401

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "Authentication required"
}
06

Błędy

HTTP 400

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Czytelny dla człowieka komunikat o błędzie.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Czytelne dla człowieka podsumowanie walidacji.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Komunikaty walidacyjne identyfikowane przez publiczne pole żądania, z tablicą czytelnych dla człowieka ciągów znaków dla każdego pola.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

Przykład odpowiedzi

JSON
{
  "error": "Validation failed",
  "errors": {
    "task_id": [
      "is required"
    ]
  }
}
07

Błędy

HTTP 402

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "Insufficient balance"
}
08

Błędy

HTTP 429

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "API key credit limit exceeded"
}
09

Błędy

HTTP 409

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "The request uses features that are not supported for the selected model"
}
10

Błędy

HTTP 429

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "Rate limit reached. Please retry later."
}
11

Błędy

HTTP 503

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "Service under maintenance, please try again later"
}
12

Błędy

HTTP 504

POST /api/v1/suno/generate_persona

Schemat odpowiedzi
JSON
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Przykład odpowiedzi

JSON
{
  "error": "The request timed out"
}
13

Wygenerowane przykłady kodu

Używaj bezpośrednio cURL lub zainstaluj SDK dla swojego języka. Każdy przykład przesyła zwalidowane żądanie pokazane w tej dokumentacji.

Instalacja

Shell
pip install runapi-suno
PYTHON
import os
from runapi.suno import SunoClient

client = SunoClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.generate_persona.run(
  task_id="tsk_reference_demo",
  audio_id="audio_reference",
  name="Studio Style",
  description="A warm and expressive acoustic pop style."
)