> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archetypeai.app/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Inference API's Direct Query endpoint (POST /api/inference/query) with the newton-c-2.6 or newton-fusion-1.0 model (text, image, and video reasoning) or the omega-embedding encoder (time-series embeddings). ATAI_API_ENDPOINT is the base URL https://platform.u1.archetypeai.app with no version path; every endpoint path begins with /api. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# About the Inference API

> Query models that the Archetype Platform hosts, in the Direct Query, OpenAI Chat Completions, or OpenAI Responses format.

Requires [version 2.0.1](https://docs.archetypeai.app/release-notes/2.0.x.md#v2-0-1) or later of the Archetype platform.

The Inference API sends a query to a model that the Archetype Platform hosts and runs for every
organization. You don't build, deploy, or stop anything: name the model in the request body's
`model` field, and the platform routes the request to a running copy of that model and returns its
answer.

The API is served under `/api/inference` and accepts three request formats on the same base URL:

| Endpoint | Format |
| - | - |
| [`POST /api/inference/query`](https://docs.archetypeai.app/api-reference/inference/query) | Direct Query, the same body as [`/api/lens/query`](https://docs.archetypeai.app/api-reference/query) |
| [`POST /api/inference/chat/completions`](https://docs.archetypeai.app/api-reference/inference/chat-completions) | OpenAI Chat Completions |
| [`POST /api/inference/responses`](https://docs.archetypeai.app/api-reference/inference/responses) | OpenAI Responses |

Because the OpenAI paths follow the OpenAI wire format, you can point an OpenAI SDK at
`https://platform.u1.archetypeai.app/api/inference` as its base URL and use your Archetype API key.

## Choosing an Endpoint

The three endpoints reach the same models: for the same input and settings, they return the same
answer. Pick by what you send and what client you already have.

| You're sending | `/inference/query` | `/inference/chat/completions` | `/inference/responses` |
| - | - | - | - |
| Text | Yes | Yes | Yes |
| Video | Yes, inline as `base64:` in `file_ids` | Yes, a `video_url` part | Yes, an `input_video` part |
| Still images | No | Yes, `image_url` parts, several per message | Yes, `input_image` parts |
| Omega embeddings and sessions | Yes (only here) | No | No |
| `repetition_penalty` | Applied | Accepted and ignored | Accepted and ignored |
| An OpenAI SDK | No | Yes | Yes |

1. **Moving from the Direct Query API, or using Omega:** use `/inference/query`. It takes the
   body you already send to `/api/lens/query`, with a new URL and model name. It's also the only
   endpoint that applies `repetition_penalty`, which stops Newton repeating itself in long lists.
2. **Sending images, or already using an OpenAI SDK:** use `/inference/chat/completions`.
3. **Already built on OpenAI's Responses API:** use `/inference/responses`. Otherwise prefer Chat
   Completions; it's the more widely supported format and behaves the same here.

On every endpoint, media go inline in a request body under 2 MiB, images and video frames are
resized to 224 × 224 pixels, and a query stops after about 60 seconds. See the [current
limitations](https://docs.archetypeai.app/api-reference/inference/migrate-from-direct-query.md#current-limitations).

## Sessions

Requests sent straight to these endpoints share one stream on the model. To give a caller its own
`values` and state on a model, [open a session](https://docs.archetypeai.app/api-reference/inference/sessions/create-session.md) and
send the same requests to it under `/api/inference/sessions/{session_id}`. See [Query a Model
Session](https://docs.archetypeai.app/api-reference/inference/sessions/query-session.md).

## Available Models

Each model answers on the endpoints listed for it. Any of a model's names works in the `model`
field.

| Model | Also known as | Direct Query | Chat Completions | Responses |
| - | - | - | - | - |
| `newton-c-2.6` | | Yes | Yes | Yes |
| `newton-fusion-1.0` | | Yes | Yes | Yes |
| `omega-embedding` | `newton-omega-1.5` | Yes | No | No |

`newton-c-2.6` and `newton-fusion-1.0` take text along with video, image, and audio input.
`omega-embedding` is a numeric encoder: it returns embeddings for sensor windows sent as
`data.numeric_array` events.

> [!NOTE]
>
> Not every input works on every endpoint yet. For example, still images and uploaded files are
> refused on `/api/inference/query`, and images and video frames are resized to 224 × 224 pixels.
> See the current limitations for [Newton
> models](https://docs.archetypeai.app/api-reference/inference/migrate-from-direct-query.md#current-limitations) and for
> [Omega](https://docs.archetypeai.app/api-reference/inference/migrate-omega-from-direct-query.md#current-limitations).

## Moving from the Direct Query API

If you call Newton or Omega on [`/api/lens/query`](https://docs.archetypeai.app/api-reference/query) today, these guides map
your requests to the Inference API and say when to stay on the Direct Query API for now:

* [Migrating from the Direct Query API](https://docs.archetypeai.app/api-reference/inference/migrate-from-direct-query.md), for
  Newton C 2.6 and Newton Fusion 1.0.
* [Migrating Omega from the Direct Query API](https://docs.archetypeai.app/api-reference/inference/migrate-omega-from-direct-query.md),
  for Omega 1.4 to Omega 1.5 embeddings.

## Errors

Errors use the standard envelope described in [Errors](https://docs.archetypeai.app/api-reference/errors.md). Every message names
the model you asked for.

| Status | Code | When |
| - | - | - |
| `400` | `bad_request` | `model` is missing, empty, or not a string. |
| `400` | `bad_request` | `stream` is `true` on Chat Completions or Responses. Streaming isn't supported yet. |
| `400` | `bad_request` | The model doesn't serve this endpoint. The message lists the endpoints it does serve, for example `model 'omega-embedding' does not serve Chat Completions; this agent answers: /api/inference/query`. |
| `400` | `bad_request` | The model refused the request body, for example because it sets a field the model doesn't support. The message is `model '<model>' refused this request`. |
| `400` | `bad_request` | The answer is larger than a query can return. Narrow the query. |
| `404` | `not_found` | No model has that name: `model '<model>' is not available`. |
| `429` | `agent_at_capacity` | The model is already answering as many queries as it will. Retry with backoff; the response carries a `Retry-After` header. |
| `500` | `agent_failed` | The model failed while answering. The message says why. |
| `503` | `unavailable` | No copy of the model is ready yet, or the one picked became unavailable. Retry shortly. |
| `503` | `node_at_capacity` | The service is already answering as many queries as it will. Retry with backoff; the response carries a `Retry-After` header. |
| `504` | `query_timeout` | The model didn't answer within its time budget. Send less data per query, or fewer queries at once. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.