Skip to main content
The SDKs call the same 82 operations as the REST API, under the names the operation table uses. Each one is built from the contract and tested against one shared list of scenarios, so they behave alike. They are alpha, like the API, and open source under the MIT license. Each repository’s README covers the rest of its SDK: client options, retries, lists and error classes.

Install

  • TypeScript. The same package runs on Bun and Deno: bun add @braskai/api or deno add npm:@braskai/api.
  • Python. With uv: uv add rask-sdk.
  • Java. With Gradle: implementation("ai.rask:rask-sdk:3.0.0-alpha.0"). Maven and Gradle take an exact version, and Maven Central shows the newest one.
  • PHP. Composer installs a pre-release only when the version constraint allows it, so the command names the alpha explicitly. Without that, Composer answers that it finds no stable version.
Then set the key where the SDK reads it, the same variable the cURL examples use:

Make a client

Every example in these pages has a tab for each language, and cURL. A tab shows the call and nothing around it: it takes a client made like this, which reads the key from RASK_API_KEY.
The methods are named after the operations and grouped as the reference is, so getMe is under account and createProject is under projects. Each language spells the names its own way. A Java example also needs the request and response classes it names, imported from the SDK’s model and params packages.

Upload, wait and handle errors

The tabs on the other pages show one call each. Three things take more than one call over plain HTTP, and every SDK does them for you: uploading a file, waiting for a job, and telling one error from another. Each tab here is a whole program that does all three: it uploads a video, dubs it into Spanish and downloads the result.
  • Running it. The TypeScript file is an ES module, because it awaits at the top level: set "type": "module" in package.json, or name the file dub.mts. Node runs a TypeScript file without a build step from version 22.18.
  • The upload asks for an upload, sends the bytes to storage without your key and completes it. It answers with the media_import job, whose result names the media. The SDK tells the content type by the file’s extension: for a name it cannot tell, pass the type.
  • The price. estimateProject gives it as total_minutes. The program sends that as expected_cost_minutes, the most it may spend, and keeps it as the cap of the dub it may start later. The project also takes a project credit, which the estimate counts in total_projects. While projects.unlimited is true in getBalance, it takes none, and total_projects is 0.
  • The wait uses the long-poll of getJob, for up to 4 hours unless you pass a longer time, as below. A file_restore job or a long localization run can take more: how long a job takes gives the times. A job that failed or was canceled comes back as an error that holds the job. A wait that ran out of time comes back as an error that holds the job’s id, and leaves the job running: wait again with that id.
  • The dub is a job of its own. The job that createProject starts ends when translation ends. Its result.auto_dub names the dub_job_id to wait for when its state is dispatched. When it is skipped (skipped_reason says why) or not_requested, nothing was charged for a dub: the program prices one with estimateDub and starts it with createDub within the same cap, or stops if the price went up.
  • The keys. Every SDK sends an Idempotency-Key by itself and repeats it on its own retries, but a new run makes new keys. So the program saves each key in a file next to the video, with the media and the price, before it sends the request. Run it again after a crash or a timeout and it sends the same keys: the API replays what already ran and charges nothing twice. The API keeps a key 24 hours, and a key replays its job even when the job failed or was canceled, so delete the file to start new work. Idempotency says why.
  • The download. An output’s link is presigned: it takes no key, and it works for 1 hour. Downloads describes every output.
  • Errors are one class for each HTTP status under one base class, and each holds the code to branch on. Errors lists the codes. These are the classes a dub program meets, under the same names in every SDK:

What every SDK does for you

  • Keeps the key where it belongs. The key goes only to the base URL. A presigned upload goes without it, and a redirect that leaves the base URL drops it.
  • Retries safely. A request that can be retried is sent again with the same Idempotency-Key, so nothing is charged twice. Idempotency explains the rule the SDK follows.
  • Waits for jobs. One call waits for a job to finish, with the long-poll the API offers.
  • Uploads a file in one call, and pages through a list for you.
  • Survives new values. A value or a variant this version does not know reaches your code as it came, so a newer API does not break an older SDK.
  • Gives typed errors, with the code to branch on. Errors lists them.

Base URL and wait timeout

The default is https://api.rask.ai/v3. To send requests through a gateway, set RASK_BASE_URL or pass the base URL to the client. A path prefix is kept. A wait lasts up to 4 hours unless you pass a longer time to it.

Without an SDK

Every guide here uses plain HTTP, and the contract is served at https://api.rask.ai/v3/openapi.json, so any OpenAPI generator can build a client. Introduction shows how to read it from code.