AI92 on julkaistu – globaali pehmokäynnistyksemme on käynnissä: koko alusta on avoinna maailmanlaajuisesti ensimmäiset 30 päivää.
Dokumentaatiovalikko

Nämä kehittäjädokumentit ovat tällä hetkellä vain englanniksi. Koodi ja API:n toiminta ovat identtiset kaikilla alueilla.

Quickstart — your first API call in 5 minutes

Make a real request against the AI92 API using a sandbox key: full API surface, zero credit cost, nothing billed.

Why no demo key? We never embed live API keys in documentation — keys in docs end up in scrapers, CI logs and LLM training sets. Generating your own sandbox key takes ~30 seconds and everything on this page is copy-paste runnable with it.

1. Get your sandbox key

  1. Log in to your AI92 dashboard and open My API (top workspace switcher → API).
  2. Go to the API Keys tab → under Sandbox keys, click Generate sandbox key.
  3. Name it (e.g. local-dev) and click Generate.
  4. Copy the key now — it is shown only once. Sandbox keys start with ai92_test_.

Store it as an environment variable so it never lands in your code or shell history:

bash
export AI92_API_KEY="{{YOUR_SANDBOX_KEY}}"

2. Authenticate

Every request sends your key as a Bearer token:

Authorization: Bearer {{YOUR_SANDBOX_KEY}}

That's the only supported scheme — no X-API-Key header, no query-string keys. Sandbox (ai92_test_*) and live (ai92_live_*) keys work identically; the key prefix decides the mode, and sandbox responses carry the header x-ai92-sandbox: true so you can always tell them apart.

3. Make your first call

GET /v1/account returns your account profile and credit balance. It's a free endpoint — 0 credits.

curl

bash
curl https://api.ai92.ai/v1/account \
  -H "Authorization: Bearer $AI92_API_KEY"

Python

python
import os, httpx

resp = httpx.get(
    "https://api.ai92.ai/v1/account",
    headers={"Authorization": f"Bearer {os.environ['AI92_API_KEY']}"},
)
resp.raise_for_status()
print(resp.json())
print("credits left:", resp.headers["x-credits-remaining"])

Node.js

javascript
const resp = await fetch("https://api.ai92.ai/v1/account", {
  headers: { Authorization: `Bearer ${process.env.AI92_API_KEY}` },
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
console.log(await resp.json());
console.log("credits left:", resp.headers.get("x-credits-remaining"));

Response — 200 OK

json
{
  "account_id": "acct_9f2e17c4d8",
  "status": "active",
  "tier": "STARTER",
  "rate_limit_rps": 10,
  "credit_balance": 2516,
  "sandbox": true,
  "created_at": "2026-07-01T09:14:02Z"
}

Response headers tell you what the call cost — on every single request:

x-credits-consumed: 0
x-credits-remaining: 2516
x-ai92-request-id: d7fc5948-71ee-48be-8b08-8d87fb994845
x-ai92-sandbox: true

HTTP/2 note: header names arrive lowercase (x-credits-consumed). Read them case-insensitively.

4. Understand what things cost

Every operation's price is in its API reference summary, and x-credits-consumed is authoritative — reconcile against the header, not the price list. A taste of the catalog:

OperationCredits
GET /v1/account, /v1/brands, /v1/contacts/searchFree
GET /v1/contacts/{company_id} — company lookup2
POST /v1/contacts/reveal — email / email+phone3 / 5
POST /v1/seo/audit — full site audit (async)20
GET /v1/ai-visibility/{brand_id} — AI-visibility overview27
POST /v1/creative/generate — AI image50

Fair metering, in one paragraph: you are never charged for failures. Zero or unknown results → no charge. A 5xx on our side → no charge. Async jobs reserve credits at submit and automatically refund if the job fails — refunds appear as ledger entries in your dashboard (My API → Billing). If your balance can't cover a call you get a pre-flight 402 INSUFFICIENT_CREDITS and nothing is deducted.

5. Handle errors

Every non-2xx response uses one envelope:

json
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "API key not found or revoked",
    "status": 401,
    "documentation_url": "https://ai92.ai/docs/errors"
  }
}

The three you'll meet first:

StatusCodeMeaning / fix
401AUTHENTICATION_REQUIREDAuthorization header missing or not Bearer <token> — check step 2
401INVALID_API_KEYKey revoked, mistyped, or from another environment
422INVALID_REQUESTMissing/invalid fields — the message lists each one (e.g. "Field required: client_id")

Also worth knowing before production: 402 INSUFFICIENT_CREDITS (top up or enable auto-recharge), 403 IP_NOT_ALLOWED (key has an IP allowlist), 429 (back off using Retry-After).

python
resp = httpx.get(url, headers=headers)
if resp.status_code >= 400:
    err = resp.json()["error"]
    raise RuntimeError(f"{err['code']}: {err['message']} → {err['documentation_url']}")

Next steps

  • Webhooks — get HMAC-signed events pushed to you instead of polling (with retries, a dead-letter queue and replay).
  • Credits & metering — the full price catalog and the reserve→refund model.
  • Sandbox & test mode — how to trigger every error path (402, 429, idempotent replays) safely.
  • Going live — swap ai92_test_ for ai92_live_, set per-key spending caps and an IP allowlist, and ship.