---
title: SDKs
url: https://runapi.ai/docs/resources/sdks.md
canonical: https://runapi.ai/docs/resources/sdks
locale: en
---

# SDKs

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/suno
```

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

```shell
pip install runapi-suno
composer require runapi-ai/suno
gem install runapi-suno
go get github.com/runapi-ai/suno-sdk/go@latest
```

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

```kotlin
dependencies {
  implementation("ai.runapi:runapi-suno:0.2.0")
}
```

```xml
<dependency>
  <groupId>ai.runapi</groupId>
  <artifactId>runapi-suno</artifactId>
  <version>0.2.0</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](/docs/guides/authentication). Keep keys in your secret manager
rather than application source code.

## 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](/docs/resources/cli) for shell automation, local checks, and
callback debugging. For exact request fields, Task responses, and
errors, use the [API Reference](/docs).
