# Test keys

> A test key does everything a live key does except spend. Prices are real, results are placeholders, nothing is charged.

## What a test key does

- Starts with `dfsr_test_`. A live key starts with `dfsr_live_`.
- Quotes the exact price, the same as a live key. Dry runs are identical.
- Holds and charges nothing. No model runs.
- Returns a placeholder file a few seconds later. Results say `"test": true`.
- Has its own results, callback log and callback signing secret. A test key never sees live results and a live key never sees test results (a wrong-mode id answers `NOT_FOUND`).

**cURL**

```bash
curl -X POST https://app.diffusr.ai/api/v2/make_image \
  -H "Authorization: Bearer $DIFFUSR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "prompt": "A can of sparkling water on a wet street, soft morning light",
  "aspect_ratio": "1:1"
}'
```

**TypeScript**

```ts
import { Diffusr } from "diffusr";

const d = new Diffusr(); // reads DIFFUSR_KEY
const job = await d.makeImage({
  prompt: "A can of sparkling water on a wet street, soft morning light",
  aspect_ratio: "1:1",
});
const result = await d.waitFor(job.id);
console.log(result.output?.url);
```

**Python**

```python
from diffusr import Diffusr

d = Diffusr()  # reads DIFFUSR_KEY
job = d.make_image(
    prompt="A can of sparkling water on a wet street, soft morning light",
    aspect_ratio="1:1",
)
result = d.wait_for(job["id"])
print(result["output"]["url"])
```

## What a test key cannot do

- Use ads routes, or video templates (`run_template` with a video template). These answer `TEST_MODE_UNSUPPORTED` (403).
- Run more than a fixed number of test runs a day: see [Limits](https://diffusr.ai/docs/limits) (`TEST_LIMIT`).

A test key can upload files. Test uploads are kept for a shorter time: see [Uploads and media](https://diffusr.ai/docs/uploads).

## Moving to live

Change nothing but the key. Run a dry run, show the price to the person, and start with a live key.

Source: https://diffusr.ai/docs/test-keys
