> ## Documentation Index
> Fetch the complete documentation index at: https://docs.relayai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Relay

> Detect audio artifacts in your Voice AI pipeline

## Build custom artifact detection models

Relay is a developer platform for detecting audio artifacts in Voice AI output. Train custom models on your data, then run inference to find glitches, hallucinations, unnatural pauses, and other issues in your TTS audio.

<CardGroup cols={2}>
  <Card title="Upload Audio" icon="upload" href="/guides/uploading-audio">
    Upload labeled audio files to build your training dataset
  </Card>

  <Card title="Train Models" icon="brain" href="/guides/training-models">
    Train custom detection models on your annotated data
  </Card>

  <Card title="Run Inference" icon="magnifying-glass" href="/guides/running-inference">
    Detect artifacts in production audio with timestamped results
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Complete REST API documentation with examples
  </Card>
</CardGroup>

## Quick example

Run inference on audio to detect artifacts:

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.relayai.dev/api/v1/inference-jobs \
    -H "X-API-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model_id": "your-model-id",
      "config": {
        "threshold": 0.5
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.relayai.dev/api/v1/inference-jobs",
      headers={"X-API-Key": "YOUR_API_KEY"},
      json={
          "model_id": "your-model-id",
          "config": {"threshold": 0.5}
      }
  )
  job = response.json()
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://api.relayai.dev/api/v1/inference-jobs", {
    method: "POST",
    headers: {
      "X-API-Key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model_id: "your-model-id",
      config: { threshold: 0.5 }
    }),
  });
  const job = await response.json();
  ```
</CodeGroup>

Detection results include timestamps and confidence scores:

```json theme={null}
{
  "detections": [
    {
      "artifact_type": "glitch",
      "start_ms": 1200,
      "end_ms": 1450,
      "confidence": 0.87
    },
    {
      "artifact_type": "long_pause",
      "start_ms": 3500,
      "end_ms": 4200,
      "confidence": 0.92
    }
  ]
}
```

## How it works

<Steps>
  <Step title="Create a Dataset">
    Define the artifact types you want to detect (glitch, silence, hallucination, etc.)
  </Step>

  <Step title="Upload Audio">
    Upload labeled audio files in WAV, MP3, FLAC, or other common formats
  </Step>

  <Step title="Add Annotations">
    Mark where artifacts occur in each file with start/end timestamps
  </Step>

  <Step title="Train a Model">
    Submit a training job to build a custom model from your annotated data
  </Step>

  <Step title="Run Inference">
    Upload new audio files to detect artifacts using your trained model
  </Step>
</Steps>

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get up and running in 5 minutes
  </Card>

  <Card title="Authentication" icon="key" href="/guides/authentication">
    Learn how to authenticate with the API
  </Card>
</CardGroup>
