Skip to content
RunAPI Developer Docs
Developer Resources
Developer Resources

SDKs

Install a typed RunAPI SDK, authenticate it with an API key, and choose the right Task lifecycle for your application.

RunAPI SDKs provide typed clients for supported model families in JavaScript, Python, PHP, Java, Ruby, and Go. Choose the language package for the model family your application calls.

Install a model SDK

Install the package that matches your language and model family. For example, install the Suno JavaScript SDK:

SHELL
npm install @runapi.ai/[email protected]

The same model family is available through the package manager for each supported runtime:

SHELL
pip install runapi-suno==0.4.2
composer require runapi-ai/suno:0.3.1
gem install runapi-suno --version 0.4.2
go get github.com/runapi-ai/suno-sdk/[email protected]

For Java, add the Suno module with Gradle or Maven:

KOTLIN
dependencies {
  implementation("ai.runapi:runapi-suno:0.3.1")
}
XML
<dependency>
  <groupId>ai.runapi</groupId>
  <artifactId>runapi-suno</artifactId>
  <version>0.3.1</version>
</dependency>

Authenticate the client

Set RUNAPI_API_KEY in the environment before creating a client. The SDK uses a RunAPI API key for the same account context as your REST requests and CLI workflow.

SHELL
export RUNAPI_API_KEY="runapi_..."

Create and rotate keys in the Authentication Guide. Keep keys in your secret manager rather than application source code.

Work with Files and Uploads

Every Provider Client exposes persistent files and multipart uploads resources from its core package. The existing files.create method still creates a temporary URL; use files.createFile in JavaScript, Java, and PHP, files.create_file in Python and Ruby, or Files.CreateFile in Go to create a persistent File object.

JAVASCRIPT
const file = await client.files.createFile({
  file: new Blob([fileBytes], { type: "application/pdf" }),
  filename: "knowledge.pdf",
  purpose: "user_data",
});

const bytes = await client.files.content(file.id);
await client.files.deleteFile(file.id);

Use uploads.create, addPart, complete, and cancel when a request is split into Parts. Python and Ruby use add_part; Go uses AddPart. See Files and Uploads for limits, REST examples, and the complete lifecycle.

Transcribe audio synchronously

The OpenAI Transcription SDK uploads a local audio file and returns the completed transcription in the same request. JSON response formats return a language-native object; text, SRT, and VTT formats return the exact response string.

JAVASCRIPT
import { OpenaiTranscriptionClient } from "@runapi.ai/openai-transcription";

const client = new OpenaiTranscriptionClient();
const transcript = await client.speechToText.run({
  file: new Blob([audioBytes], { type: "audio/mpeg" }),
  filename: "interview.mp3",
  response_format: "json",
});

See the Audio Transcription API reference for file formats, model-specific fields, and response formats.

Work with asynchronous Tasks

Many media operations are asynchronous. Use create to submit a Task and receive its id immediately, get to retrieve its current state, or run to submit and poll until it reaches a terminal state. In a web request handler, prefer create plus a callback or later get polling so the request does not hold a worker open.

JavaScript

JAVASCRIPT
import { SunoClient } from "@runapi.ai/suno";

const client = new SunoClient();
const result = await client.textToMusic.run({
  model: "suno-v5",
  vocal_mode: "auto_lyrics",
  prompt: "A short piano theme",
});

console.log(result.audios[0].audio_url);

Python

PYTHON
from runapi.suno import SunoClient

client = SunoClient()
result = client.text_to_music.run(
    model="suno-v4.5-plus",
    vocal_mode="auto_lyrics",
    prompt="A short piano theme",
)

print(result.audios[0].audio_url)

PHP

PHP
<?php

use RunApi\Suno\SunoClient;

$client = new SunoClient();
$result = $client->textToMusic->run([
    'model' => 'suno-v5.5',
    'vocal_mode' => 'auto_lyrics',
    'prompt' => 'A short piano theme',
]);

print_r($result->toArray());

Ruby

RUBY
require "runapi/suno"

client = RunApi::Suno::Client.new
result = client.text_to_music.run(
  model: "suno-v4.5-plus",
  vocal_mode: "auto_lyrics",
  prompt: "A short piano theme"
)

puts result.dig("audios", 0, "audio_url")

Go

GO
package main

import (
    "context"
    "fmt"
    "log"
    "os"

    "github.com/runapi-ai/core-sdk/go/option"
    "github.com/runapi-ai/suno-sdk/go/suno"
)

func main() {
    client, err := suno.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
    if err != nil {
        log.Fatal(err)
    }

    result, err := client.TextToMusic.Run(context.Background(), suno.TextToMusicParams{
        SunoBaseParams: suno.SunoBaseParams{Model: suno.ModelV45Plus},
        VocalMode: suno.VocalModeAutoLyrics,
        Prompt:    "A short piano theme",
    })
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(result.ID)
}

Java

JAVA
import ai.runapi.suno.SunoClient;
import ai.runapi.suno.types.CompletedTextToMusicResponse;
import ai.runapi.suno.types.TextToMusicModel;
import ai.runapi.suno.types.TextToMusicParams;

SunoClient client = SunoClient.builder()
    .apiKey(System.getenv("RUNAPI_API_KEY"))
    .build();

CompletedTextToMusicResponse result = client.textToMusic().run(
    TextToMusicParams.builder()
        .model(TextToMusicModel.SUNO_V5)
        .vocalMode("auto_lyrics")
        .prompt("A short piano theme")
        .build()
);

Choose the next workflow

Use an SDK when your application benefits from typed request builders and language-native Task helpers. Use the RunAPI CLI for shell automation, local checks, and callback debugging. For exact request fields, Task responses, and errors, use the API Reference.