1.0.0 • Published 7 months ago

@ryomak/suno-api v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Suno AI TypeScript Module

SunoAIを利用するためのTypeScriptモジュールです。

インストール

npm install

使用方法

import { SunoClient } from './src';

const client = new SunoClient({
  sessionId: 'your_session_id',
  cookie: 'your_cookie'
});

// 曲一覧を取得
const songs = await client.getSongs();

// いいねした曲の一覧を取得
const likedSongs = await client.getLikedSongs();

// 曲を作成
const newSong = await client.createSong({
  prompt: 'A happy song about sunshine',
  make_instrumental: false,
  wait_audio: true
});

// 曲にいいね
await client.likeSong('song_id');

// いいねを取り消し
await client.unlikeSong('song_id');

API機能

  • getSongs(): 曲一覧取得
  • getLikedSongs(): いいねした曲の一覧取得
  • createSong(): 曲作成
  • likeSong(): いいね処理
  • unlikeSong(): いいね取り消し
  • getSongById(): ID指定で曲取得

設定

SunoClientのコンストラクタには以下の設定が必要です:

  • sessionId: SunoのセッションID
  • cookie: Sunoのクッキー
  • baseUrl: APIのベースURL(省略可、デフォルト: https://studio-api.suno.ai)# suno-api
1.0.0

7 months ago