> ## 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.

# Inference: Responses

> Query a platform-hosted model with an OpenAI Responses request

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

## Overview

This endpoint takes an [OpenAI Responses](https://platform.openai.com/docs/api-reference/responses/create)
request and sends it to a model that the Archetype Platform hosts. `model` names one of the
[available models](https://docs.archetypeai.app/api-reference/inference/about#available-models) that serves Responses:
`newton-c-2.6` or `newton-fusion-1.0`. The platform forwards the body to a running copy of that
model and returns its `response` object unchanged.

You can call it with an OpenAI SDK by setting the base URL to
`https://platform.u1.archetypeai.app/api/inference` and the API key to your Archetype API key.

## Request

**model** `string` *required*

Name of the model to query: `newton-c-2.6` or `newton-fusion-1.0`. A model that doesn't serve
Responses, such as `omega-embedding`, returns `400`. An unknown name returns `404`.

**input** `string | object[]` *required*

The conversation: a string, or a list of messages. A message's `content` is a string or a list
of parts: `input_text`, `input_image`, `input_video`, and `input_audio`. To
continue a conversation, append the previous response's `output` to `input`.
Send images and video inline as `data:` URIs, in a request body under 2 MiB; every image and
video frame is resized to 224 × 224 pixels. See [Current
Limitations](https://docs.archetypeai.app/api-reference/inference/migrate-from-direct-query.md#current-limitations).

**instructions** `string`

A system message for the model.

**stream** `boolean` (default: false)

Must be `false` or omitted. Streaming isn't supported yet, and `true` returns `400`.

**max\_output\_tokens** `integer`

Maximum number of tokens to generate.

**temperature** `number`

Sampling temperature, from `0` to `2`.

**top\_p** `number`

Nucleus sampling cutoff, from `0` to `1`.

**store** `boolean`

Accepted with any value, and ignored: the platform doesn't store responses.

> [!NOTE]
>
> Options that need stored state or features the model doesn't have return `400`:
> `previous_response_id`, `conversation`, `reasoning`, a `text` format other than plain text,
> non-empty `tools`, a `tool_choice` other than `none` or `auto`, non-empty `include`, a
> `truncation` other than `disabled`, a non-zero `top_logprobs`, `background: true`, `prompt`,
> `max_tool_calls`, non-empty `context_management`, `moderation`, and non-empty `metadata`. Their
> OpenAI defaults are accepted, so an SDK that sends every field still works.

## Notes for OpenAI SDK Users

* **Newton Fusion 1.0's reasoning arrives in the answer.** The text starts with a `<think>...</think>`
  block, empty when the model answered directly; remove it before showing the answer.
  `reasoning` is refused. To answer without reasoning, end the user text with ` /no_think`: it
  works when the request includes an image or video, and on a text-only request the model
  reasons anyway. See [Reasoning](https://docs.archetypeai.app/api-reference/inference/migrate-from-direct-query.md#reasoning).
* **`repetition_penalty` is ignored here.** It isn't an OpenAI field; sent through the SDK (for
  example in `extra_body`), it's accepted and has no effect. If the model repeats itself in long
  lists, send the request to [`/inference/query`](https://docs.archetypeai.app/api-reference/inference/query), which applies it.
* **Media go inline.** Send images and video as `data:` URIs; uploaded files can't be referenced.
* **A query stops after about 60 seconds** and returns `504`. Keep answers short with the token
  limit and the prompt; see [Choosing an Endpoint](https://docs.archetypeai.app/api-reference/inference/about#choosing-an-endpoint).

## Response

The model's [response object](https://platform.openai.com/docs/api-reference/responses/object).
The OpenAI SDKs expose the answer text as `output_text`.

```bash cURL theme={"system"}
curl -X POST "$ATAI_API_ENDPOINT/inference/responses" \
  -H "Authorization: Bearer $ATAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "newton-fusion-1.0",
    "instructions": "You are a safety inspector.",
    "input": "List three checks to run before starting a conveyor belt."
  }'
```

```python Python theme={"system"}
import os
from openai import OpenAI

client = OpenAI(
    base_url=f"{os.environ['ATAI_API_ENDPOINT']}/inference",
    api_key=os.environ["ATAI_API_KEY"],
)

response = client.responses.create(
    model="newton-fusion-1.0",
    instructions="You are a safety inspector.",
    input="List three checks to run before starting a conveyor belt.",
)

print(response.output_text)
```

```javascript JavaScript theme={"system"}
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: `${process.env.ATAI_API_ENDPOINT}/inference`,
  apiKey: process.env.ATAI_API_KEY
});

const response = await client.responses.create({
  model: 'newton-fusion-1.0',
  instructions: 'You are a safety inspector.',
  input: 'List three checks to run before starting a conveyor belt.'
});

console.log(response.output_text);
```

```json 400 - The model doesn't serve Responses theme={"system"}
{
  "errors": [
    {
      "code": "bad_request",
      "message": "model 'newton-omega-1.5' does not serve Responses; this agent answers: /api/inference/query",
      "suggestion": null,
      "error_uid": "err-xxxxxxxx"
    }
  ]
}
```

```json 404 - Unknown model theme={"system"}
{
  "errors": [
    {
      "code": "not_found",
      "message": "model 'newton-c-9' is not available",
      "suggestion": null,
      "error_uid": "err-xxxxxxxx"
    }
  ]
}
```

## Important Notes

> [!NOTE]
>
> * Every error is listed in [Errors](https://docs.archetypeai.app/api-reference/inference/about#errors) on the Inference API overview.
> * Errors use the Archetype error envelope, not OpenAI's. An OpenAI SDK raises them as API errors with the HTTP status.
> * `400` with `model '<model>' refused this request` means the model rejected the body, for example
>   because it sets one of the unsupported options above.


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