# Test mode

A key that starts with `sk_test_` runs in test mode: **no real verification is performed and no credits are used**. Use it to build your integration and in automated tests.

## Predictable verdicts

Syntax is still checked. After that, the verdict is chosen by the local part of the address (the text before `@`):

| Address | `verdict` | `reason_code` |
| --- | --- | --- |
| `valid@…` | `valid` | |
| `invalid@…` | `invalid` | |
| `risky@…` | `risky` | `catch_all` |
| `disposable@…` | `risky` | `disposable_domain` |
| Anything else | `unknown` | |

The contract fixes the `reason_code` only for the two `risky` cases. Assert on `verdict` in the others.

```bash
curl https://api.salchimail.com/v1/verify \
  -H "Authorization: Bearer $SALCHIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "risky@example.com", "mode": "mailbox"}'
```

## What is different from live mode

- Objects carry `"livemode": false`, including `GET /account` and `GET /usage`.
- No credits are charged or reserved.
- Test batches complete within seconds, so you can exercise the whole [batch flow](https://docs.salchimail.com/batches.md): create, poll, download.
- The mail server of the address is never contacted.

Everything else is the same contract: the same endpoints, fields, [errors](https://docs.salchimail.com/limits-and-errors.md) and [idempotency](https://docs.salchimail.com/idempotency.md) rules.

## Suggested use

- Keep a `sk_test_` key in your development and CI environments, and the `sk_live_` key only in production.
- Cover each branch of your code with the matching address: one test with `valid@`, one with `invalid@`, one with `risky@` and one with an address that gives `unknown`.
- Check `livemode` in your tests to make sure they never run against live credits.
