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

# Test Mode (Coming Soon)

> Develop and test your integration without affecting production data

Bota provides test and live API keys to help you develop and test your integration safely. Both key types use the same API endpoint.

***

## API Keys

Each project has separate API keys for test and live modes:

```bash theme={null}
# Test mode - development and testing
curl https://api.bota.dev/v1/end-users \
  -H "Authorization: Bearer sk_test_abc123..."

# Live mode - production
curl https://api.bota.dev/v1/end-users \
  -H "Authorization: Bearer sk_live_xyz789..."
```

### Key Types by Mode

| Key Type     | Test Mode   | Live Mode   |
| ------------ | ----------- | ----------- |
| Secret key   | `sk_test_*` | `sk_live_*` |
| Device token | `dtok_*`    | `dtok_*`    |
| Upload token | `up_*`      | `up_*`      |

<Warning>
  Test and live modes are completely isolated. EndUsers, devices, and recordings created with test keys do not exist in live mode and vice versa.
</Warning>

***

## Test Mode Behavior

### What's the Same

* Same API endpoint (`https://api.bota.dev/v1`)
* All API endpoints work identically
* Request/response formats are identical
* Webhooks are delivered normally
* Error codes and messages match production

### What's Different

| Feature              | Test Mode           | Live Mode           |
| -------------------- | ------------------- | ------------------- |
| **Billing**          | Not charged         | Usage is metered    |
| **Transcription**    | Real ASR processing | Real ASR processing |
| **Data persistence** | Permanent           | Permanent           |
| **Rate limits**      | Same as live        | 100 req/sec         |
| **Webhooks**         | Delivered normally  | Delivered normally  |

<Info>
  Test mode uses real ASR processing, so transcription quality and timing match production. This ensures your integration behaves identically when you go live.
</Info>

***

## Multiple Projects for Environments

For more robust environment separation, create multiple projects within your organization:

| Project         | Purpose             | API Keys                   |
| --------------- | ------------------- | -------------------------- |
| **Production**  | Live customer data  | `sk_live_*`                |
| **Staging**     | Pre-release testing | `sk_live_*` or `sk_test_*` |
| **Development** | Local development   | `sk_test_*`                |

This approach provides:

* Complete data isolation between environments
* Separate webhook configurations per environment
* Independent rate limits and quotas
* Clear audit trails per environment

***

## Testing Webhooks

Webhooks in test mode work exactly like production. Events are delivered to your configured endpoints with valid signatures.

### Testing Locally

Use a tunneling service like [ngrok](https://ngrok.com) to receive webhooks during local development:

```bash theme={null}
# Start ngrok tunnel
ngrok http 3000

# Use the ngrok URL when creating webhook endpoints
curl -X POST https://api.bota.dev/v1/webhooks \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://abc123.ngrok.io/webhooks/bota",
    "events": ["transcription.completed"]
  }'
```

### Trigger Test Events

Create resources with test keys to trigger webhook events:

```bash theme={null}
# Create a recording (triggers recording.created)
curl -X POST https://api.bota.dev/v1/recordings \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "end_user_id": "eu_abc123",
    "device_id": "dev_xyz789"
  }'

# Start transcription (triggers transcription.completed when done)
curl -X POST https://api.bota.dev/v1/transcriptions \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "recording_id": "rec_abc123"
  }'
```

***

## Going Live Checklist

Before switching from test mode to production:

<Steps>
  <Step title="Update API keys">
    Replace `sk_test_*` keys with `sk_live_*` keys in your production environment
  </Step>

  <Step title="Verify webhook endpoints">
    Ensure your production webhook URLs are configured and accessible
  </Step>

  <Step title="Test with real devices">
    Verify Bluetooth pairing and upload flows work with actual hardware
  </Step>

  <Step title="Monitor initial requests">
    Watch for errors in your first production API calls
  </Step>
</Steps>

***

## Environment Variables

We recommend using environment variables to manage your API configuration:

<CodeGroup>
  ```bash .env.development theme={null}
  BOTA_API_KEY=sk_test_abc123...
  BOTA_WEBHOOK_SECRET=whsec_test_xyz789...
  ```

  ```bash .env.production theme={null}
  BOTA_API_KEY=sk_live_abc123...
  BOTA_WEBHOOK_SECRET=whsec_live_xyz789...
  ```
</CodeGroup>

```javascript theme={null}
// Your code uses the same logic regardless of environment
const bota = new BotaClient({
  apiKey: process.env.BOTA_API_KEY,
});
```

***

## Cleaning Up Test Data

To clean up test data, delete the resources directly:

```bash theme={null}
# Delete a test end user (also deletes associated recordings, transcriptions, summaries)
curl -X DELETE https://api.bota.dev/v1/end-users/eu_abc123 \
  -H "Authorization: Bearer sk_test_..."
```

<Note>
  Deleting an EndUser also deletes all associated recordings, transcriptions, and summaries.
</Note>
