Skip to content
Back to skills

Atai Newton Omega Inference Api

CSecurity

Get time-series embeddings from the Omega encoder on the Inference API (Newton Omega 1.5, model `omega-embedding`, `/api/inference/*`) — send a window of sensor readings, get back a 768-d vector per channel. Use this skill to embed multivariate sensor windows for client-side KNN classification, anomaly scoring, similarity search, or 2D projection — including a web app over a folder of sensor CSVs (build its UI with `atai-design-system`). For numeric time-series, this is the Inference API skil...

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 20, 2026
ai-agentspythongoshellbashgitapi

Works with

  • cli
  • api

Security analysis

C71/100
  • criticalModifies startup scripts or system services for persistence
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 7 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add archetypeai/agent-skills --skill atai-newton-omega-inference-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Atai Newton Omega Inference Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Atai Newton Omega Inference Api
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/archetypeai-atai-newton-omega-inference-api/badge)](https://www.skillsdirectory.com/skills/archetypeai-atai-newton-omega-inference-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: atai-newton-omega-inference-api
description: >
  Get time-series embeddings from the Omega encoder on the
  Inference API (Newton Omega 1.5, model `omega-embedding`,
  `/api/inference/*`) — send a window of sensor readings, get back a 768-d
  vector per channel. Use this skill to embed multivariate sensor windows
  for client-side KNN
  classification, anomaly scoring, similarity search, or 2D projection —
  including a web app over a folder of sensor CSVs (build its UI with
  `atai-design-system`). For numeric
  time-series, this is the Inference API skill, not
  `atai-newton-fusion-inference-api`. Covers sessions and `window_size`
  (16–1024), the `data.numeric_array` request, the response shape, the
  shared-scaler convention, the request-size limit, and the joint-state +
  KNN pattern. Prep raw CSVs first with `atai-newton-omega-model-data-prep`.
  Do NOT use when the user asks for the Direct Query API or Omega 1.4
  (`atai-newton-omega-model`). Do NOT use for text, images or video
  (`atai-newton-fusion-inference-api`); for a folder with both, use the two
  skills together.
---

# Newton Omega 1.5 Encoder — Time-Series Embeddings on the Inference API

Omega is a **time-series encoder**: feed it a window of sensor readings, get back a fixed-size embedding you can do ML on. This skill calls Newton Omega 1.5 on the **Inference API**: open a session with your window length, send windows to it, get embeddings back. No batch job.

## Which Omega skill?

During the move from the Direct Query API to the Inference API, there are two Omega skills. Each API serves one version: Omega 1.4 only on the Direct Query API, Omega 1.5 only on the Inference API.

| | This skill | [`atai-newton-omega-model`](../atai-newton-omega-model/SKILL.md) |
|---|---|---|
| API | Inference API (`/api/inference/*`) | Direct Query API (`/api/lens/query`) |
| Model | Newton Omega 1.5 (`omega-embedding`) | Newton Omega 1.4 (`OmegaEncoder::omega_embeddings_1_4`) |
| Window length | Set per session (16–1024); 1024 without one | Any length 16–1024 per request |
| Requests per window | One, all channels together | One per channel |
| Use when | Starting new work, or the user asks for the Inference API, Model Serving or Omega 1.5 | The user asks for the Direct Query API or Omega 1.4, or an existing Omega 1.4 library must keep working unchanged |

The two versions' embeddings aren't comparable, so pick one per project. When this skill doesn't fit — current limitations as of November 15, 2026, on production — see [Migrating Omega from the Direct Query API](https://docs.archetypeai.app/api-reference/inference/migrate-omega-from-direct-query#current-limitations): no Omega 1.4, one window length per session, 16 open sessions per model, and sessions that can end at any time.

**Accounts:** the free trial (`try.archetypeai.app`) doesn't serve `omega-embedding`; this skill needs a production account. On a free trial, use the Omega Encoder agent instead ([`atai-omega-encoder-agent`](../atai-omega-encoder-agent/SKILL.md)).

## When to Apply

- Embed multivariate sensor windows (vibration, pressure, flow, network, …) into vectors
- Build lightweight downstream ML over those vectors **client-side**: KNN classification, anomaly scoring, similarity search, PCA/UMAP projection
- Prototype classification without standing up the managed batch pipeline

**Do not use this skill when:**
- The user asks for the Direct Query API or Omega 1.4 — use [`atai-newton-omega-model`](../atai-newton-omega-model/SKILL.md)
- The input is text, an image, or a video — that's [`atai-newton-fusion-inference-api`](../atai-newton-fusion-inference-api/SKILL.md). For a folder with both, use the two skills together.
- You need fully-managed, server-side classification over millions of rows

For preparing the raw sensor CSVs (timestamp regularity, gap-aware blocks, temporal-order train/test split, the joint-state feature matrix), see [`atai-newton-omega-model-data-prep`](../atai-newton-omega-model-data-prep/SKILL.md).

## The Model

```
omega-embedding
```

Newton Omega 1.5. Output is a **768-dimensional embedding per channel**.

**Coming from Omega 1.4** (`OmegaEncoder::omega_embeddings_1_4` on `/api/lens/query`)? The two models' embeddings are not comparable (cosine similarity between −0.03 and 0.02 for the same window), so rebuild every n-shot library with 1.5 — never mix vectors from the two.

## Endpoints

`ATAI_API_ENDPOINT` may be the deployment root or end in `/api`; the Console shows the `/api` form (`https://platform.u1.archetypeai.app/api` on production). Build `API_BASE` once: drop a trailing `/` and `/api`, then add `/api`. Write every path against `API_BASE`, so both forms work: a doubled or missing `/api` returns 404.

```bash
API_BASE="${ATAI_API_ENDPOINT%/}"; API_BASE="${API_BASE%/api}/api"
```

```js
const API_BASE = ATAI_API_ENDPOINT.replace(/\/+$/, '').replace(/\/api$/, '') + '/api';
```

All under `{API_BASE}`, with `Authorization: Bearer <API_KEY>` and `Content-Type: application/json`:

| Call | Request | Purpose |
|---|---|---|
| Open a session | `POST /inference/sessions` with `{"model": "omega-embedding", "values": {"window_size": N, "step_size": N}}` | Fix the window length (16–1024). Returns `{"id": ...}` |
| Query the session | `POST /inference/sessions/{id}/query` | Embed windows of length N |
| Cancel the session | `POST /inference/sessions/{id}/cancel` (empty body) | Free its place under the org's session limit |
| Query without a session | `POST /inference/query` | Window fixed at 1024 |

**Both `ATAI_API_KEY` and `ATAI_API_ENDPOINT` are required** — there is no default endpoint, so a wrong-deployment mistake fails loudly at startup.

## Request Shape — all channels in one query

```json
{
  "model": "omega-embedding",
  "query": "",
  "events": [
    { "type": "data.numeric_array", "event_data": { "contents": [[/* channel 1: N floats */], [/* channel 2 */]] } }
  ]
}
```

`contents` is **channel-first**: `[channels x timesteps]`. No `file_ids`, no prompt. The session query needs `model` in the body too.

**Send all of a window's channels in one query.** Omega 1.5 encodes each channel independently, so the vectors are the same whether channels travel together or apart (measured: largest difference 0.0000) — one query is simply fewer calls. The exception is very wide data: request bodies are capped at **2 MiB** (HTTP 413 above it), about 95 channels × 1024 timesteps at full float precision. Split wider windows into groups of channels and join the vectors; [`_common.py`](references/_common.py) does this at 64 channels per request.

## Response — `[windows, channels x 768]`

```json
{
  "response": {
    "success": true,
    "response": [[/* channel 1: 768 floats, then channel 2: 768 floats, ... */]]
  }
}
```

Each **row** is one window: the channels' 768-d vectors concatenated in channel order. Split a row into `channels` slices of 768.

## Window length — sessions

The session fixes the window. Every query sent to it is cut into `window_size`-timestep windows, advancing `step_size`, and each full window returns one row:

- **Exactly `window_size` timesteps** → one row. This is the normal case: slice your data yourself and send one window per query.
- **Longer** → back-to-back windows, one row each; timesteps past the last full window are **dropped**.
- **Shorter** → `success: false` with an empty response and **no error message**. Check `success`.
- **Without a session** (`/inference/query`), the window is always 1024.

The encoder is trained for **16–1024 timesteps**. Windows shorter than 1024 are padded **and masked** inside the model, so padding is ignored rather than read as signal. Pick the length that matches your signal's dynamics and **compare a few on held-out data** — the best length depends on the data *and* on how many channels you embed (see the table below).

**Session lifecycle.** A session ends when you cancel it, when it sits idle long enough, or when the server holding it is replaced; a query then returns HTTP 409 with code `session_not_running`. Open a new one and retry — `OmegaSession` in [`_common.py`](references/_common.py) does this. Each org can hold 16 open sessions per model (as of November 2026); the 17th returns HTTP 429 `session_limit_reached`, so cancel sessions when you're done (`with OmegaSession(...)` does). Asking for an unknown session value returns HTTP 422 `invalid_session_values`.

## Normalization — one shared scaler

Omega 1.5 z-normalizes each channel **inside every window** and passes the window's overall level (mean and spread) to the model separately, so amplitude differences between windows survive. There is **no `normalize_input` option** to set.

Still fit **one** per-channel scaler (mean/std) on your n-shot pool and apply it to every window — library and inference alike. It keeps the level information on one reference frame. On a single bearing channel it added 7–10 points of held-out accuracy at windows of 64 and 256 (no difference at 1024).

**Per-channel embeddings.** To get one fingerprint for a multi-channel window, concatenate the per-channel vectors into a **joint multi-channel state** (e.g. 4 channels → a 3072-d feature), optionally L2-normalized. That single vector is what you feed to KNN / anomaly / projection.

See [`embed_query.py`](references/embed_query.py): the call without a session, sessions at 16 / 256 / 1024, what a session does with longer and shorter input, and the channel-independence check.

## Downstream pattern — embeddings → KNN classification

This is what the managed batch pipeline does, reproduced client-side:

0. **Prep + normalize once** — fit a per-channel scaler (mean/std) on the n-shot training pool and apply it to every window. Vet the shot files first with [`omega-1-5-preflight`](https://github.com/archetypeai/omega-1-5-preflight) (static checks, plus an optional held-out pilot on Omega 1.5) and prep raw CSVs with [`atai-newton-omega-model-data-prep`](../atai-newton-omega-model-data-prep/SKILL.md).
1. **Open a session** with the window length you chose, and use it for every window below.
2. **Build an n-shot library** — embed several labelled windows per class (e.g. `healthy` / `degraded`), fold each window's per-channel vectors into one joint feature, L2-normalize.
3. **Classify** a new window the same way and take a majority vote over the *k* nearest library features (euclidean).

A few dozen labelled embeddings make a serviceable classifier — no training, no batch job. See [`classify_knn.py`](references/classify_knn.py): it builds the library from the labelled shot files and runs a **genuine held-out evaluation** against `bearing_inference.csv` (sensors only — **no `label` column**, and timestamps disjoint from the shot files, so leakage is impossible two ways over), scoring predictions against `bearing_labels.csv`.

It reports a full binary metrics report (`degraded` = positive), and `--window-size` accepts one or more lengths — each runs as a separate full eval with its own session (library and test windows at that length), with a comparison table at the end. On **1000 held-out windows** per length, the sweep `--window-size 16 64 256 1024` scored (production, 2026-11-15):

```
 window  library  windows  accuracy  precision  recall     f1
-------------------------------------------------------------
     16       16     1000     0.734      0.794   0.632  0.704
     64       16     1000     0.954      0.987   0.920  0.952
    256       14     1000     0.970      0.947   0.996  0.971
   1024        8     1000     0.998      0.996   1.000  0.998
```

With all four channels in the joint feature, accuracy rises with the window: at 16 the window is shorter than the defect's impulse signature and recall collapses; at 1024 only 2 of 1000 windows are wrong. The answer is not universal, though — embedding **one** channel (`bearing_1` only, as in the platform quickstart) reverses it: 64 scored 94%, 256 85% and 1024 82% on 100 held-out windows, because the long single-channel windows flag healthy windows as degraded. Sweep a few lengths on *your* setup and let held-out F1 pick; the default here is 1024 because it wins on this one.

## Classifying a whole recording

To label every window of a long recording, don't send one query per window. Lay the windows end to end in one session query: with `step_size` equal to `window_size`, the session cuts the input back into the same windows and returns one row per window, in order. The windows don't need to be contiguous in the recording — any windows laid end to end come back as the rows they would give alone.

Measured on production (2026-11-19, one account, 6 channels × 128 timesteps, session `window_size` = `step_size` = 128):

| Request | Latency |
|---|---:|
| 1 window | ~0.25 s |
| 10 windows in one query | 1.8 s |
| 50 windows in one query | 8.0 s |
| 100 windows in one query | 15.8 s |
| 8 one-window queries, one after another | 1.8 s |
| 8 one-window queries, all in flight | 1.8 s |

- **Request size doesn't change the vectors.** A window's vector was identical (largest difference 0) whether it was sent alone or as one of 10. Unlike Omega 1.4 on the Direct Query API, there is no need to pad every request to a fixed size.
- **Throughput stayed at about 6 windows/s however the windows were sent.** In this run, queries in flight together took as long as the same queries one after another, and batching saved only the per-request overhead. That differs from the parallel gains in [Latency](#latency) (1024-timestep windows, 8 in flight), so measure on your own account before counting on concurrency.
- **Send chunks of about 10–50 windows**, so a UI can show progress and each body stays well under the 2 MiB cap: 100 windows × 6 channels × 128 timesteps was a 1.5 MB body at full float precision.

End to end, a recording of 127 windows classified in 21 s and one of 151 windows in 28 s (chunks of 10, two in flight).

## Latency

Measured per window on production (p50 of 12, sequential, nothing else sharing the model), all channels in one query, 1024 timesteps:

| Channels | Latency | Channel embeddings/s with 8 queries in flight |
|---:|---:|---:|
| 1 | ~0.3 s | ~18 |
| 4 | ~0.5 s | ~35 |
| 16 | ~1.0 s | ~45 |

| Operation | Observed |
|-----------|---------:|
| n-shot library (8–16 windows) | a few seconds |
| Held-out eval (1000 windows × 4 channels, 8 in flight) | **~2–3 min** per window length; 15–20 min while other jobs share the model |

Queries to one session are independent, so `classify_knn.py` sends several at once with `--workers`.

## Building a web app

- **Build the UI with [`atai-design-system`](../atai-design-system/SKILL.md).** Load that skill before writing any front-end code; it scaffolds the app and installs the design system's own agent instructions. Don't hand-roll HTML/CSS.
- **Keep the API key out of the browser.** Call Omega from server routes (for example SvelteKit `+server.ts`) and never put `ATAI_API_KEY` in client code. If the app follows the design system's pattern of pasting the key into the UI, send it to your server routes with each request rather than calling the API from the page.
- **Give `.env` precedence over the shell** when the app reads it (see [Common Pitfalls](#common-pitfalls)).
- **Use one session for the whole app.** Open it on first use, reuse it for every request, reopen it on HTTP 409, and cancel it on shutdown. Under a dev server with hot reload, keep the session id on a global so each reload doesn't open a new session against the 16-per-model limit.
- **Save the n-shot library to disk** (the vectors and the scaler), keyed by model and window length, so restarting the app doesn't embed it again. Rebuild it when either changes.
- **Cache each window's result**, so selecting a window again or rerunning a recording is instant.

## Common Pitfalls

- **Channel-first, not row-major.** `contents` is `[channels x timesteps]` (one list per sensor), not `[timesteps x channels]`. Transposing gives garbage embeddings.
- **Drop the timestamp column.** A `timestamp` parses as a number, so naive "use all numeric columns" includes it as a fake channel — and if your class files have disjoint time ranges, a downstream classifier can cheat on it. Exclude time columns (the helper drops `timestamp`/`time`/… by header name; pass your own `time_columns` set if your data names them differently).
- **Temporal contiguity matters.** Omega reads a window as an ordered series; randomly-sampled or gap-spanning rows produce meaningless embeddings. Sample contiguous blocks. (See `atai-newton-omega-model-data-prep` for gap-aware windowing.)
- **Input shorter than the window fails silently.** The response is `success: false` with an empty list and no message. Check `success`, and slice every query to exactly `window_size` timesteps.
- **One window length per model.** The library and the inference windows must use the same session `window_size`; mixing lengths invalidates KNN distances.
- **No mixing of model versions.** Omega 1.4 and 1.5 vectors are not comparable. Rebuild the library when you switch.
- **Ended sessions return HTTP 409.** Reopen and retry rather than failing the run; cancel sessions you no longer need.
- **Very wide windows hit HTTP 413.** Above about 95 channels × 1024 timesteps, split channels across requests (the vectors are the same).
- **Shell variables beat `.env`.** An `ATAI_API_KEY` or `ATAI_API_ENDPOINT` exported in your shell (for example in `~/.zshrc`) overrides `.env` in the scripts (`load_dotenv(override=False)`) and in any app that reads the environment before `.env`. A stale exported key then fails (for example `403 org_trial_expired`) even though `.env` is right. Unset the variable, or make the app read `.env` first.

## Local Setup

```bash
# In a virtualenv (system pythons are often PEP 668 "externally managed"):
python3 -m venv .venv && source .venv/bin/activate
pip install -r skills/atai-newton-omega-inference-api/references/requirements.txt

# Drop a .env at the repo root (or anywhere up the tree from the run dir).
# BOTH variables are required — there is no default endpoint:
cat > .env <<EOF
ATAI_API_KEY=sk_...
ATAI_API_ENDPOINT=https://platform.u1.archetypeai.app/api
EOF

cd skills/atai-newton-omega-inference-api/references
python embed_query.py     # embedding basics
python classify_knn.py    # n-shot KNN classification
```

The scripts are built on the [official Archetype AI python client](https://github.com/archetypeai/python-client) (`pip install archetypeai`): each script creates one client via `make_client()`, opens an `OmegaSession`, and the POSTs go through the client's retrying transport. They auto-load `.env` if `python-dotenv` is installed (`find_dotenv()` walks up from cwd); otherwise export `ATAI_API_KEY` and `ATAI_API_ENDPOINT`. `numpy` is required for `classify_knn.py`.

## File Layout

```
skills/atai-newton-omega-inference-api/
├── SKILL.md                  ← this file
├── references/
│   ├── _common.py            ← official-client setup, OmegaSession, embed_once, CSV/window helpers
│   ├── embed_query.py        ← embedding basics (no session, window lengths, session input rules, channels)
│   ├── classify_knn.py       ← embeddings → n-shot KNN classification (held-out eval)
│   ├── requirements.txt      ← runtime deps (pip install -r requirements.txt)
│   └── .env.example          ← copy to .env and fill in
└── tests/
    └── test_references.py    ← network-free unit tests (python -m unittest)
```

The bearing sample data is shared with the Direct Query skill rather than copied: the scripts and tests read it from [`../atai-newton-omega-model/references/sample_data/`](../atai-newton-omega-model/references/sample_data/README.md) (healthy and degraded shot files, a held-out inference file with no label column, and its labels; the README there has the attribution).

Files in this skill

  • SKILL.md16.3 KB
  • references/.env.example220 B
  • references/_common.py12.3 KB
  • references/classify_knn.py15.7 KB
  • references/embed_query.py5.7 KB
  • references/requirements.txt130 B
  • tests/test_references.py15.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.