From signup to first API call in 2 minutes

Quickstart —your first API call.

Three steps. Python, Node.js, or cURL — pick your favourite. Free tier is 300 API calls / month with no credit card. Drop the snippets below straight into your terminal or editor.

Prerequisites

  • An mSightFlow account — sign up free (no card)
  • An API key (we'll create one in step 2)
  • One of: Python 3.9+ with requests, or Node 18+ with node-fetch, or curl
  • An image file (any JPG/PNG works — your_image.jpg below)

Three steps to your first call

  1. 01

    Sign up

    Free tier is 300 API calls / month, no credit card. Sign up at /signup. Verify your email; you're in.

  2. 02

    Create an API key

    Go to /dashboard/keys and click Create key. Copy it once — the dashboard shows it once for security. Store it in an env var.

  3. 03

    POST an image

    Pick a language below; copy the snippet; replace your_image.jpg; set MSF_API_KEY; run. Median latency is ~150 ms for detection.

Store the key in an env var

Never commit API keys to git. Set the env var per-session or per-project.

bash / zsh (macOS / Linux)
export MSF_API_KEY="msf_live_..."
# Make it persistent: add the line to ~/.bashrc or ~/.zshrc
PowerShell (Windows)
$env:MSF_API_KEY = "msf_live_..."
# Persistent: setx MSF_API_KEY "msf_live_..."

Your first call — pick a language

Python · requests
import os, requests
from pathlib import Path

resp = requests.post(
    "https://api.msightflow.ai/v1/detect",
    headers={"Authorization": f"Bearer {os.environ['MSF_API_KEY']}"},
    files={"image": Path("your_image.jpg").read_bytes()},
    data={"model": "yolov8m", "return_overlay": "true"},
)

result = resp.json()
print(f"Found {len(result['detections'])} objects")
for d in result["detections"]:
    print(f"  {d['label']:>20}  {d['confidence']:.2f}  {d['box']}")
Node.js · node-fetch
import fetch from "node-fetch";
import FormData from "form-data";
import fs from "fs";

const form = new FormData();
form.append("image", fs.createReadStream("your_image.jpg"));
form.append("model", "yolov8m");

const resp = await fetch("https://api.msightflow.ai/v1/detect", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.MSF_API_KEY}` },
  body: form,
});

const { detections } = await resp.json();
console.log(`Found ${detections.length} objects`);
detections.forEach((d) =>
  console.log(`\t${d.label}  ${d.confidence.toFixed(2)}  [${d.box.join(", ")}]`),
);
cURL
curl -X POST https://api.msightflow.ai/v1/detect \
  -H "Authorization: Bearer $MSF_API_KEY" \
  -F "image=@your_image.jpg" \
  -F "model=yolov8m" \
  -F "return_overlay=true"
What you'll get back (JSON)
{
  "detections": [
    {
      "label": "person",
      "confidence": 0.94,
      "box": [102, 88, 412, 670]
    },
    {
      "label": "hard_hat",
      "confidence": 0.81,
      "box": [156, 92, 280, 168]
    }
  ],
  "overlay_png": "<base64 image with boxes drawn>",
  "model": "yolov8m",
  "latency_ms": 142
}

What to try next

The detection endpoint above is one of 15 capabilities. Each feature page has its own quickstart-shaped code block.

FAQ — the things that bite people

I'm getting 401 Unauthorized.

Your MSF_API_KEY env var isn't set, isn't exported, or has stray whitespace. Try echo "[$MSF_API_KEY]" — the brackets should hug the value tightly. Also: keys created in the dashboard are immediately active, but require ~30 seconds to propagate; wait a moment before your first call.

I'm getting 429 Too Many Requests.

Free tier is 300 calls / month. The 429 means you've hit the cap. Either wait until the first of next month, or upgrade at /pricing (Standard is 1,500/mo for $10/mo).

My image is > 25 MB and the call fails.

25 MB is the per-request image limit. Resize or recompress to JPEG with quality 85-90 before uploading; that takes most photos down to < 5 MB without visible quality loss. For batch processing of many large images, see batch export.

The response is slower than the docs say.

Cold-start happens on the first call after ~5 min of idle on shared infra; expect ~600 ms instead of ~150 ms. After warm-up the p50 you see in the features page applies. Each endpoint lists its own p50.

Which model should I use?

Default yolov8m is the sweet spot of speed and accuracy. Use yolov8n when latency matters more than accuracy, or yolov8l for higher accuracy when latency is fine.

API key in 30 seconds. First call in 90 more.

300 free calls / month. No credit card. No qualifying call. Every endpoint included.

Stuck on the first call? Get in touch — we typically reply within a day.