Build with 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
Section titled “What a test key does”- Starts with
dfsr_test_. A live key starts withdfsr_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 -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"}'import { Diffusr } from "diffusr";
const d = new Diffusr(); // reads DIFFUSR_KEYconst 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);from diffusr import Diffusr
d = Diffusr() # reads DIFFUSR_KEYjob = 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
Section titled “What a test key cannot do”- Use ads routes, or video templates (
run_templatewith a video template). These answerTEST_MODE_UNSUPPORTED(403). - Run more than a fixed number of test runs a day: see Limits (
TEST_LIMIT).
A test key can upload files. Test uploads are kept for a shorter time: see Uploads and media.
Moving to live
Section titled “Moving to live”Change nothing but the key. Run a dry run, show the price to the person, and start with a live key.