Skip to content

Quickstart

Create an API key, send one request and read the verdict. It works on the Free plan, in a project where nothing is configured yet.

One request screens a piece of text and returns a verdict, a score for every policy and a recommendation: allow, review or reject. A new project needs no setup for that: a request that names no template runs the built-in basic check, which every plan includes.

You need a terminal with curl, or Node.js 18 or later, or Python with requests.

  1. Create an account

    Sign up with your name, a work email and a password, tick the two boxes that say you agree to the Terms of Service and have read the Privacy Policy, then enter the 6-digit code Infrared emails you. No card is asked for.

    You land on the Overview of a project called "Default", inside an organisation named after the one you typed (or after you, when you left that field empty). The project already holds the basic check and nothing else.

  2. Create an API key

    Open Settings, API keys and choose Create key. Give it a name, pick Test as the environment and leave the three scopes ticked.

    The panel shown after a test key is created: the full key, a note that it is shown only once, and a curl request that uses it.
    Dashboard, Settings, API keysThe key is shown once, with a first request already filled in. In a project that has templates, the sample names one of them.

    Copy the key and keep it in an environment variable. Infrared stores only a hash of it, so it cannot be shown again.

    TerminalShell
    export INFRARED_KEY="ir_test_..."
  3. Send a request

    Post the text to /v1/moderations. type is text when you leave it out; it is spelled out here because the next thing you send will be an image.

    curl https://api.useinfrared.com/v1/moderations \
      -H "Authorization: Bearer $INFRARED_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "text",
        "input": "Worst seller ever. You are a complete idiot."
      }'
  4. Read the response

    Text is screened while the request waits, so the answer is the finished moderation.

    200 OK, trimmedJSON
    {
      "object": "moderation",
      "id": "mod_41RdNecZ5qkb9qsBisl5Pf",
      "template": { "slug": "basic", "version": 1 },
      "type": "text",
      "status": "completed",
      "flagged": true,
      "recommendation": "reject",
      "severity": "critical",
      "policies": {
        "toxicity": 0.98,
        "hate_speech": 0,
        "profanity": 0,
        "violence": 0,
        "self_harm": 0,
        "sexual": 0,
        "illicit": 0,
        "spam": 0
      },
      "triggered": ["toxicity"],
      "rule": null,
      "reasons": ["trigger:toxicity:flag", "triage:reject"],
      "details": {
        "toxicity": {
          "matches": [
            {
              "label": "span",
              "value": "Worst seller ever.",
              "reason": "This is a strong insult directed at a seller."
            },
            {
              "label": "span",
              "value": "You are a complete idiot.",
              "reason": "This is a direct insult to a person."
            }
          ]
        }
      },
      "author": null,
      "language": "en",
      "usage": { "checks": 0, "cached": false },
      "dry_run": false,
      "test": true,
      "content_id": null,
      "context_id": null,
      "metadata": null,
      "created_at": "2026-10-08T09:11:47.109Z",
      "completed_at": "2026-10-08T09:11:49.925Z"
    }

    The scores come from a model, so the numbers in your run can differ slightly. The verdict and the recommendation follow from the thresholds, not from the exact number.

    Worst seller ever. You are a complete idiot.
    FlaggedTriggered
    text

    recommendationReject

    The same result as the dashboard draws it: the verdict, and what to do with the content.

    Four fields carry the answer. The rest is described in The moderation object.

    flaggedboolean

    true when a policy set to flag has triggered. This is the SAFE or FLAGGED verdict.

    recommendationstring

    What to do with the content. Your code branches on this.

    One ofallowreviewreject

    policiesmap

    A score from 0 to 1 for every policy that ran, keyed by policy. Here toxicity crossed its threshold of 0.70.

    detailsmap

    What each policy matched, where there is something to quote: the words, a label and a reason.

  5. Act on the recommendation

    The recommendation is advice your backend carries out: Infrared never publishes or removes anything in your product.

    switch (moderation.recommendation) {
      case "allow":
        await publish(listing);
        break;
      case "review":
        // Hold it. The item is now in the review queue of the dashboard.
        await holdForReview(listing, moderation.id);
        break;
      case "reject":
        await reject(listing, moderation.triggered);
        break;
    }
  6. See it in the dashboard

    Open the Live console. The moderation is at the top of the list. Open it to see its verdict card, the score of each policy, what matched and the JSON your code received.

    The list of the live console, newest first: eight moderations with their type, template, id, latency and verdict, and the open one, a flagged test request, marked.
    Dashboard, Live consoleEvery moderation as it happens, newest first.

What ran

The request named no template, so the project's basic check screened it: eight policies (toxicity, hate_speech, profanity, violence, self_harm, sexual, illicit and spam) and no rules of your own. With no content rule to decide, severity triage turned the highest score into the recommendation: allow below 0.40, review from 0.40, reject from 0.80.

reasons records that path. trigger:toxicity:flag says which policy flagged the text, triage:reject says triage decided.

What a marketplace listing, a review or a chat message should contain, and what is a violation there, is yours to say. That is what a template is for, on Starter and up.

Next

Something missing or unclear on this page? Write to support@useinfrared.com.