Skip to main content
This guide walks you through the complete workflow: creating a dataset, uploading audio, adding annotations, training a model, and running inference.

Prerequisites

Step 1: Get your API key

  1. Sign in to app.relayai.dev
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Copy and save your key securely
API keys are only shown once. Store your key in a secure location.
Set your API key as an environment variable:

Step 2: Create a dataset

A dataset defines what artifact types you want to detect. Create one with the artifact types relevant to your use case:
Response:
Save the id from the response. You’ll need it for subsequent steps.

Step 3: Upload audio files

Audio upload uses presigned URLs for direct upload to cloud storage. The flow is:
  1. Request a presigned upload URL
  2. Upload the file to the URL
  3. Confirm the upload

Request upload URL

Response:

Upload the file

Confirm upload

After confirmation, Relay processes the audio (normalizes to 16kHz mono and computes embeddings). Check the audio file status by polling:
Python

Step 4: Add annotations

Create an annotation set and add annotations marking where artifacts occur:

Create annotation set

Add annotations

Each annotation specifies which audio file, the artifact type, and the start/end timestamps in milliseconds:

Publish the annotation set

Before training, you must publish the annotation set. Published sets are immutable.

Step 5: Train a model

Submit a training job with your dataset and published annotation set:
Poll for training completion:
Python

Step 6: Run inference

Once training completes, a model is created automatically. Create an inference job and upload audio to detect artifacts:

Create inference job

Upload audio for inference

Upload audio using the same presigned URL flow:
Python

Get detection results

Example response:

Next steps

Uploading Audio

Learn about supported formats and bulk uploads

Creating Annotations

Best practices for labeling your data

Training Models

Configure training parameters

Understanding Results

Interpret detection confidence scores