suno

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package suno implements engine.Engine for Suno music generation.

Music generation is async: POST /api/generate creates a task, GET /api/feed/{id} polls for completion. Auth: Authorization: Bearer {key}, env SUNO_API_KEY. Uses the suno-api compatible gateway interface.

Index

Constants

View Source
const (
	ModelChirpV4  = "chirp-v4"
	ModelChirpV35 = "chirp-v3.5"
)

Model constants.

Variables

View Source
var (
	ErrMissingBaseURL = errors.New("suno: missing base URL (set Config.BaseURL or SUNO_BASE_URL)")
	ErrMissingPrompt  = errors.New("suno: missing prompt in workflow graph")
)

Functions

func ConfigSchema

func ConfigSchema() []engine.ConfigField

ConfigSchema returns the configuration fields required by the Suno engine.

func ModelsByCapability

func ModelsByCapability() map[string][]string

ModelsByCapability returns all known Suno models grouped by capability.

Types

type Config

type Config struct {
	APIKey            string
	BaseURL           string // Required — Suno API gateway URL.
	Model             string
	HTTPClient        *http.Client
	WaitForCompletion bool
	PollInterval      time.Duration
	OnProgress        epoll.OnProgress
}

Config configures the Suno engine.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine implements engine.Engine for Suno.

func New

func New(cfg Config) *Engine

New creates a Suno engine instance.

func (*Engine) Capabilities

func (e *Engine) Capabilities() engine.Capability

Capabilities implements engine.Describer.

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, g workflow.Graph) (engine.Result, error)

Execute generates music via the Suno API gateway.

func (*Engine) Resume

func (e *Engine) Resume(ctx context.Context, remoteID string) (engine.Result, error)

Resume implements engine.Resumer — resumes polling a previously submitted task.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL