---
title: Separate Sandbox & Production AI Environments | APIkit
description: Run separate dev, staging, and production AI endpoint keys with isolated logs, rate caps, and model routing.
canonical: "https://apikit.ai/j/separate-sandbox-production-keys"
modified: 2026-11-14
author: apikit.ai editorial team
source: "https://apikit.ai"
category: API Key Auth, Scopes & Quotas
category_url: "https://apikit.ai/j#group-api-auth-permissions"
---

# Isolate sandbox experiments from live production endpoints

> Keep developer tests, noisy experimental prompts, and QA budgets strictly separated from customer-facing production telemetry and billing.

## Prepared starting prompt

Developer test payloads keep cluttering our production accuracy metrics and logs. I want isolated sandbox vs production keys and environments.

### Quick scenarios
- **Clean prod metrics:** Keep staging traffic and experimental errors completely out of production SLA dashboards.
- **Cheaper dev models:** Point sandbox environments to ultra-cheap fast models while production runs frontier tiers.
- **Distinct key prefixes:** Ensure ak_test_ keys cannot touch production routes even if copied accidentally.

- [Join APIkit early access](https://apikit.ai/#waitlist-f73a0d)

## Steps to keep staging and prod strictly isolated

1. **Enforce environment-locked keys** — Restrict test keys exclusively to sandbox endpoints so QA scripts never hit customer production.
2. **Apply strict sandbox spend caps** — Cap dev keys at low daily limits to catch broken local scripts immediately without high bills.
3. **Mirror production schema contracts** — Keep staging JSON schemas identical to production so client integration bugs surface before release.
4. **Tag telemetry by environment** — Filter analytics views cleanly between dev, staging, and live customer traffic.

## Frequently Asked Questions

### Can staging environments route to cheaper models automatically?

Yes. Environment overrides let sandbox keys run compact models to cut QA costs while testing identical endpoint schemas.

### What happens if someone accidentally commits a test key?

Distinct ak_test_ prefixes alert secret scanners immediately, and tight sandbox caps limit blast radius while leaving live keys untouched.

### How do verified staging drafts reach production?

Once staging tests and evals pass, promote the exact revision snapshot to production without changing live keys.

## Related tasks in this category

- [Issue scoped API keys per customer and environment](https://apikit.ai/j/issue-scoped-tenant-api-keys.md)
- [Meter and cap monthly token quotas per tenant](https://apikit.ai/j/enforce-monthly-token-quotas-tenants.md)
- [Rotate API keys smoothly with overlapping grace windows](https://apikit.ai/j/rotate-compromised-keys-grace-window.md)
- [Verify end-user JWT claims directly at your AI endpoint](https://apikit.ai/j/validate-end-user-jwt-tokens.md)
- [Lock internal AI endpoints to approved IP and CIDR ranges](https://apikit.ai/j/restrict-endpoint-access-ip-allowlist.md)
- [Configure exact CORS origin policies for browser clients](https://apikit.ai/j/configure-cors-origins-browser-calls.md)

---

*Published by **Wondel.ai sp. z o.o.** · [apikit.ai](https://apikit.ai) · [About](https://apikit.ai/about) · [Editorial Guidelines](https://apikit.ai/editorial) · [Contact](https://apikit.ai/contact) · [Wondel.ai Products](https://wondel.ai/products)*