Create multilook chat completions (Mk1)
curl --request POST \
--url https://api.perceptron.inc/v1/chat/completions/multilook \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.perceptron.inc/v1/chat/completions/multilook"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.perceptron.inc/v1/chat/completions/multilook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perceptron.inc/v1/chat/completions/multilook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.perceptron.inc/v1/chat/completions/multilook"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.perceptron.inc/v1/chat/completions/multilook")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perceptron.inc/v1/chat/completions/multilook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyChat completions
Create multilook chat completions (Mk1)
Send a shared context and up to 16 prompts to Perceptron Mk1 in one call; the context is prefilled once and reused across all prompts.
POST
/
v1
/
chat
/
completions
/
multilook
Create multilook chat completions (Mk1)
curl --request POST \
--url https://api.perceptron.inc/v1/chat/completions/multilook \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.perceptron.inc/v1/chat/completions/multilook"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.perceptron.inc/v1/chat/completions/multilook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perceptron.inc/v1/chat/completions/multilook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.perceptron.inc/v1/chat/completions/multilook"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.perceptron.inc/v1/chat/completions/multilook")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perceptron.inc/v1/chat/completions/multilook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyOverview
A multilook request carries a sharedcontext and up to 16 prompts. The context uses the same message format as /v1/chat/completions, including media parts (image_url, video_url, video_frames, image_file_id, video_file_id). The context is prefilled once per call and reused across all prompts; each prompt extends it independently and produces n completions. Prompts are isolated from one another: no prompt observes another prompt’s text or completions.
This page shows the fields Perceptron Mk1 uses. The full gateway request schema is in the Perceptron Mk1.5 reference.
Reused prefill is reported in usage.prompt_tokens_details.cached_tokens and billed at the cache-read rate. The Multilook guide covers when to use it, how billing works, and Python client code.
Request
curl https://api.perceptron.inc/v1/chat/completions/multilook \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PERCEPTRON_API_KEY" \
-d '{
"model": "perceptron-mk1",
"context": [
{ "role": "user",
"content": [
{ "type": "video_url",
"video_url": { "url": "https://raw.githubusercontent.com/perceptron-ai-inc/perceptron/main/cookbook/_shared/assets/tutorials/isaac_frame_by_frame/surf.mp4" }
}
]
}
],
"prompts": [
"How many people are visible?",
"Describe the setting in one sentence.",
"Does anyone pick up an object? If so, what?"
],
"n": 1,
"max_completion_tokens": 128
}'
| Field | Description |
|---|---|
model | The model to invoke. |
context | Shared prefix all prompts extend. Same message format as /v1/chat/completions, including media parts (image_url, video_url, video_frames, file ids). Prefilled once per call. |
prompts | 1–16 independent sequences extending the shared prefix. Each entry is the content of an implicit final user turn: a bare string, or { "content": [ ...parts ] } with the same part types as user messages. |
n | Completions per prompt, 1–8. n > 1 requires temperature > 0. |
max_completion_tokens | Maximum completion tokens, per completion (up to 8192). |
temperature, top_p, top_k, frequency_penalty, presence_penalty | Sampling parameters, applied to all prompts. |
vision_config | Perceptron vision-model controls (e.g. enable_thinking), applied to all prompts. |
temperature defaults to 0.0, so set it explicitly whenever n > 1.
stream, response_format, and stop are not supported on this endpoint.
Structured prompts
A prompt can be a bare string or an object carrying content parts, so individual prompts can bring their own media alongside the shared context:"prompts": [
"Describe the setting in one sentence.",
{ "content": [
{ "type": "image_url", "image_url": { "url": "<image-url>" } },
{ "type": "text", "text": "Does this still frame match the video?" }
]
}
]
prompts entry sit outside the shared prefix: they are fetched, preprocessed, and prefilled per prompt, and are not reported in cached_tokens. Media intended for reuse across prompts belongs in context. See Per-prompt media in the guide for a full example.
Response
One entry per prompt, in request order:{
"id": "mlcmpl-2b9e41",
"object": "chat.completion.multilook",
"model": "perceptron-mk1",
"results": [
{ "prompt_index": 0,
"completions": [
{ "index": 0,
"message": { "role": "assistant", "content": "Two people are visible." },
"finish_reason": "stop" }
],
"usage": { "completion_tokens": 6 } },
{ "prompt_index": 1,
"completions": [
{ "index": 0,
"message": { "role": "assistant", "content": "A surfer rides a wave on an open stretch of ocean under a clear sky." },
"finish_reason": "stop" }
],
"usage": { "completion_tokens": 18 } },
{ "prompt_index": 2,
"completions": [
{ "index": 0,
"message": { "role": "assistant", "content": "No one picks up an object during the clip; the surfer keeps both hands free while riding the wave. Nothing is lifted from the water, the board, or the shore." },
"finish_reason": "stop" }
],
"usage": { "completion_tokens": 70 } }
],
"usage": {
"prompt_tokens": 35612,
"completion_tokens": 94,
"total_tokens": 35706,
"prompt_tokens_details": { "cached_tokens": 25872 }
}
}
error object in place of its completions; other prompts are unaffected. The call returns 200 if at least one prompt succeeded; if all prompts fail, the whole request returns the first error’s status. See Handling partial failures for an example and client code.
cached_tokens is the subset of prompt_tokens served from the in-request prefill. Reuse is scoped to the call: a subsequent identical call reports cached_tokens: 0. Billing rates and a worked example are in the guide’s Billing section.
Limits
| Limit | Value |
|---|---|
| Prompts per call | 1–16 |
Completions per call (prompts × n) | 64 |
| Image/video inputs per call | 256 (each video frame counts as one) |
| Request body size | 20 MB |
| Requests | 150/min (separate bucket from /v1/chat/completions) |
| Request budget | 300 s. On timeout, retry with fewer prompts, lower n, or smaller max_completion_tokens |
Need higher limits? Contact support@perceptron.inc.