AI92 je v živo - naša globalna predčasna predstavitev je v teku: celotna platforma je odprta po vsem svetu prvih 30 dni.
Meni dokumentacije

Ta razvijalska dokumentacija je trenutno na voljo samo v angleščini. Koda in obnašanje API-ja sta enaka v vseh regijah.

Sandbox

The sandbox is a full, isolated copy of the AI92 API for development and testing. It is free — no credits are ever spent — and it returns deterministic fixture data, so you can build and test against stable, predictable responses before you touch production.

Entering the sandbox

There is nothing to configure. Use an ai92_test_ key instead of an ai92_live_ key, against the same host:

bash
curl "https://api.ai92.ai/v1/contacts/search?q=saas+founder&country=US" \
  -H "Authorization: Bearer ai92_test_YOUR_SANDBOX_KEY"

The key prefix routes the request to the sandbox dataset. Every sandbox response carries:

http
X-AI92-Sandbox: true

Use that header in tests to assert you really are in the sandbox.

What's different in the sandbox

Sandbox (ai92_test_)Production (ai92_live_)
Credits chargedNever (free)Yes
DataDeterministic fixturesReal, live data
X-Credits-ConsumedReports the would-be costReports the real charge
IsolationSeparate sandbox datasetProduction dataset
Rate limitsApply (sandbox quotas)Apply (tier limits)

Because the cost is still reported in X-Credits-Consumed, you can validate your credit-accounting logic in the sandbox without spending anything.

Deterministic fixtures

Sandbox endpoints return fixed, repeatable responses keyed off your request — the same input gives the same output every run. This makes the sandbox ideal for automated tests and CI: assertions don't flake because the data doesn't move.

Use the documented demo identifiers (e.g. person_id: "ph_demo_01", a demo brand_id) to hit known fixtures. Async endpoints behave identically — they return a job_id, and polling resolves to a fixture result.

Testing each outcome

The sandbox lets you exercise every branch of your error and billing handling without engineering real-world failures:

Outcome you want to testHow
Successful paid callReveal a known demo person_id200, X-Credits-Consumed shows the price, no real charge.
Free / unbilled resultVerify an email fixture that resolves status: "unknown""credits_consumed": 0.
Insufficient credits (402)Use a sandbox key/account provisioned with a low balance, then call a paid endpoint.
Validation error (422)Send an invalid mode to /v1/contacts/reveal, or a reversed creative planning window.
Rate limiting (429)Burst past your tier's RPS — the sandbox enforces limits and returns Retry-After.
Idempotent replaySend the same POST twice with one X-AI92-Idempotency-Key; the second returns X-AI92-Idempotent-Replay: true.
Async lifecycleSubmit a /v1/creative/newsletter job and poll /v1/jobs/{job_id} through queued → completed.

Promoting to production

When your integration is green in the sandbox, swap the key prefixai92_test_ai92_live_ — and you're on production. No URL change, no code change beyond the credential. Walk the Going-live checklist before you flip the switch.

Tip: keep separate test and live keys in your config and select by environment. Never let an ai92_test_ key reach production traffic (it would hit fixture data), and never let an ai92_live_ key run your test suite (it would spend real credits).