Singing Pet API

Singing Pet には REST API があります。曲テンプレートと価格は誰でも取得できます。ユーザーの動画・クレジット・請求に関わるものはすべて Firebase の ID トークンが必要です。

OpenAPI 仕様

API 全体の機械可読な定義です。すべてのエンドポイントに一意の operation id、型付きパラメータ、レスポンススキーマがあります。クライアント生成ツールやエージェントの function calling ローダーをそのまま向けられます。

OpenAPI 仕様を見る

https://singing.pet/openapi.json

認証

Firebase Authentication の ID トークンをベアラートークンとして送ります。このサイトで Google またはメールリンクでサインインすると発行されます。公開と記載されたエンドポイントにはヘッダーは不要です。

エンドポイント

https://api.singing.pet

GET/getServiceIndex公開
GET/openapi.jsongetOpenApiSpec公開
GET/healthgetHealth公開
GET/templateslistTemplates公開
GET/subscription/pricinggetPricing公開
GET/user/megetCurrentUserトークン
GET/user/videoslistUserVideosトークン
POST/create-with-templatecreateVideoFromTemplateトークン
POST/create-with-audiocreateVideoFromAudioトークン
DELETE/delete-videodeleteVideoトークン
GET/tts/voiceslistVoicesトークン
POST/ttsgenerateSpeechトークン
POST/tiktok/extract-audioextractTikTokAudioトークン
GET/subscription/statusgetSubscriptionStatusトークン
POST/subscription/create-checkout-sessioncreateCheckoutSessionトークン
POST/subscription/create-one-time-checkoutcreateOneTimeCheckoutトークン
POST/subscription/create-portal-sessioncreatePortalSessionトークン
GET/versionslistApiVersions公開
GET/v1/templateslistApiTemplatesトークン
GET/v1/megetApiAccountトークン
GET/v1/creditsgetApiCreditsトークン
GET/v1/videoslistApiVideosトークン
POST/v1/videoscreateApiVideoトークン
GET/v1/videos/{id}getApiVideoトークン
DELETE/v1/videos/{id}deleteApiVideoトークン
POST/mcpcallMcpServerトークン

リクエスト例

curl https://api.singing.pet/templates

curl https://api.singing.pet/user/videos?page=1 \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN"

エラー

失敗はすべて JSON で返ります。個別のエンドポイントが処理しないものは、安定したコード、読めるメッセージ、次に何をすべきかのヒントを含む共通の形式を使います。

{
  "error": {
    "code": "not_found",
    "message": "No route matches GET /nope",
    "status": 404,
    "hint": "Check the path against https://singing.pet/openapi.json.",
    "documentation_url": "https://singing.pet/developers"
  },
  "message": "No route matches GET /nope"
}

レンダリングは非同期です

作成 API はレンダリングがキューに入った時点で返ります。listUserVideos をポーリングして status が pending から completed または failed に変わるのを待つか、wss://api.singing.pet の WebSocket を購読してください。

制限

音声は2秒から30秒までで、動画の長さは音声とまったく同じです。テキスト読み上げは最大500文字です。無料アカウントは毎月2本、有料プランは無制限です。

エージェント向けの Markdown

このサイトのコンテンツページは、acceptmarkdown.com に従って Accept ヘッダーで要求すると、きれいな Markdown を返します。手書きのサイト索引は llms.txt にあります。