curl -X POST "$ATAI_API_ENDPOINT/inference/chat/completions" \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "newton-c-2.6",
"messages": [
{"role": "system", "content": "You are a safety inspector."},
{"role": "user", "content": "List three checks to run before starting a conveyor belt."}
]
}'
import os
from openai import OpenAI
client = OpenAI(
base_url=f"{os.environ['ATAI_API_ENDPOINT']}/inference",
api_key=os.environ["ATAI_API_KEY"],
)
completion = client.chat.completions.create(
model="newton-c-2.6",
messages=[
{"role": "system", "content": "You are a safety inspector."},
{"role": "user", "content": "List three checks to run before starting a conveyor belt."},
],
)
print(completion.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: `${process.env.ATAI_API_ENDPOINT}/inference`,
apiKey: process.env.ATAI_API_KEY
});
const completion = await client.chat.completions.create({
model: 'newton-c-2.6',
messages: [
{ role: 'system', content: 'You are a safety inspector.' },
{ role: 'user', content: 'List three checks to run before starting a conveyor belt.' }
]
});
console.log(completion.choices[0].message.content);
{
"errors": [
{
"code": "bad_request",
"message": "model 'omega-embedding' does not serve Chat Completions; this agent answers: /api/inference/query",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "bad_request",
"message": "streaming responses are not supported on this endpoint yet",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Inference API
Inference: Chat Completions
Query a platform-hosted model with an OpenAI Chat Completions request
POST
/
api
/
inference
/
chat
/
completions
curl -X POST "$ATAI_API_ENDPOINT/inference/chat/completions" \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "newton-c-2.6",
"messages": [
{"role": "system", "content": "You are a safety inspector."},
{"role": "user", "content": "List three checks to run before starting a conveyor belt."}
]
}'
import os
from openai import OpenAI
client = OpenAI(
base_url=f"{os.environ['ATAI_API_ENDPOINT']}/inference",
api_key=os.environ["ATAI_API_KEY"],
)
completion = client.chat.completions.create(
model="newton-c-2.6",
messages=[
{"role": "system", "content": "You are a safety inspector."},
{"role": "user", "content": "List three checks to run before starting a conveyor belt."},
],
)
print(completion.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: `${process.env.ATAI_API_ENDPOINT}/inference`,
apiKey: process.env.ATAI_API_KEY
});
const completion = await client.chat.completions.create({
model: 'newton-c-2.6',
messages: [
{ role: 'system', content: 'You are a safety inspector.' },
{ role: 'user', content: 'List three checks to run before starting a conveyor belt.' }
]
});
console.log(completion.choices[0].message.content);
{
"errors": [
{
"code": "bad_request",
"message": "model 'omega-embedding' does not serve Chat Completions; this agent answers: /api/inference/query",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "bad_request",
"message": "streaming responses are not supported on this endpoint yet",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Requires version 2.0.1 or later of the Archetype platform.
Overview
This endpoint takes an OpenAI Chat Completions request and sends it to a model that the Archetype Platform hosts.model names one of the
available models that serves Chat Completions:
newton-c-2.6 or newton-fusion-1.0. The platform forwards the body to a running copy of that
model and returns its chat.completion 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
Name of the model to query:
newton-c-2.6 or newton-fusion-1.0. A model that doesn’t serve
Chat Completions, such as omega-embedding, returns 400. An unknown name returns 404.The conversation, as
system, developer, user, and assistant messages. A message’s
content is a string or a list of parts: text, image_url, video_url, and
input_audio. Tool messages and tool calls aren’t supported.
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.Must be
false or omitted. Streaming isn’t supported yet, and true returns 400.Maximum number of tokens to generate.
max_tokens is accepted as the older name; when you set
both, max_completion_tokens wins.Options that would change the answer in a way the model can’t honor return
400: a non-zero
frequency_penalty or presence_penalty, logprobs, top_logprobs, logit_bias, stop,
non-empty tools or functions, a tool_choice other than none or auto, a response_format
other than text, modalities other than ["text"], audio, web_search_options, and
reasoning_effort. 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_effortis 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. repetition_penaltyis ignored here. It isn’t an OpenAI field; sent through the SDK (for example inextra_body), it’s accepted and has no effect. If the model repeats itself in long lists, send the request to/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.
Response
The model’s chat completion object. The answer is inchoices[0].message.content.
curl -X POST "$ATAI_API_ENDPOINT/inference/chat/completions" \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "newton-c-2.6",
"messages": [
{"role": "system", "content": "You are a safety inspector."},
{"role": "user", "content": "List three checks to run before starting a conveyor belt."}
]
}'
import os
from openai import OpenAI
client = OpenAI(
base_url=f"{os.environ['ATAI_API_ENDPOINT']}/inference",
api_key=os.environ["ATAI_API_KEY"],
)
completion = client.chat.completions.create(
model="newton-c-2.6",
messages=[
{"role": "system", "content": "You are a safety inspector."},
{"role": "user", "content": "List three checks to run before starting a conveyor belt."},
],
)
print(completion.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: `${process.env.ATAI_API_ENDPOINT}/inference`,
apiKey: process.env.ATAI_API_KEY
});
const completion = await client.chat.completions.create({
model: 'newton-c-2.6',
messages: [
{ role: 'system', content: 'You are a safety inspector.' },
{ role: 'user', content: 'List three checks to run before starting a conveyor belt.' }
]
});
console.log(completion.choices[0].message.content);
{
"errors": [
{
"code": "bad_request",
"message": "model 'omega-embedding' does not serve Chat Completions; this agent answers: /api/inference/query",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "bad_request",
"message": "streaming responses are not supported on this endpoint yet",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Important Notes
- Every error is listed in 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.
400withmodel '<model>' refused this requestmeans the model rejected the body, for example because it sets one of the unsupported options above.
Was this page helpful?