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

# Test and Live

> Keep Test and Live credentials and data isolated.

Test and Live are fully isolated environments. The API key prefix (`sk_test_` vs `sk_live_`) encodes the environment, so a Test key can never address Live data and vice versa.

## Exact comparison

|                     | Test                               | Live                                           |
| ------------------- | ---------------------------------- | ---------------------------------------------- |
| Key prefix          | `sk_test_`                         | `sk_live_`                                     |
| Data isolation      | Fully isolated                     | Customer-facing                                |
| Customer visibility | Not visible to customers           | Visible through hosted paths, embeds, and APIs |
| Billing             | Not metered                        | Active Books are metered                       |
| Commitments         | Cannot create commitments          | Can create commitments                         |
| Book versions       | Draft workspaces                   | Immutable published versions                   |
| Simulations         | Supported (non-persistent)         | Supported (non-persistent)                     |
| Rate limit          | Shared across Test keys            | Shared across Live keys                        |
| Webhooks            | Test endpoints receive Test events | Live endpoints receive Live events             |

## How isolation works

The environment is determined by the key prefix before any database query runs. The API:

1. Extracts the bearer token from the `Authorization` header.
2. Reads the prefix (`sk_test_` or `sk_live_`).
3. Hashes the key with SHA-256.
4. Looks up the hash in the database, scoped to the claimed environment.
5. If the stored environment does not match the prefix, the key is rejected.

This means a Test key cannot reach Live data even if the hash matches a Live key row — the environment mismatch is a hard stop.

## Producing quotes in each environment

|                                                      | Test                                                     | Live                                                                      |
| ---------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------- |
| `POST /v1/accounts/{id}/quotes`                      | Creates a test quote (not metered, not customer-visible) | Creates a formal quote (metered, customer-visible based on autonomy mode) |
| `POST /v1/accounts/{id}/quote-simulations`           | Non-persistent, not metered                              | Non-persistent, not metered                                               |
| `POST /v1/accounts/{id}/quotes/{quoteId}/commitment` | Returns `commitment_rejected`                            | Creates a real commitment                                                 |

<Warning>
  A Test key cannot create commitments. The commitment endpoint returns `commitment_rejected` when called with a Test key.
</Warning>

## Webhooks per environment

Webhook endpoints are scoped to one environment. A Test endpoint receives only Test events; a Live endpoint receives only Live events. When you create a webhook endpoint, you choose the environment it subscribes to.

## When to use Test

* Developing and testing your integration
* Running simulations to verify pricing
* Testing quote production without affecting Live customers
* Verifying webhook signature validation

## When to use Live

* Serving real customer requests
* Producing quotes that customers see
* Creating commitments (holds, deposits, handoffs)
* Receiving real commitment events via webhooks

## Switching environments

To switch between Test and Live, use a different API key. There is no mode-switching parameter on the API — the key determines the environment. Mint a Live key from the Developers page when you are ready to go to production.

## Rate limits per environment

Rate limits are scoped to account and environment. Test and Live have separate quotas. A burst of Test requests does not consume your Live rate limit.
