curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nova:amazon.nova-lite-v1:0",
"messages": [
{
"content": "<string>"
}
],
"temperature": 1,
"max_tokens": 1000,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"n": 1,
"stream": false,
"stop": "<string>",
"extra_body": {
"metadata": {
"toolConfig": {
"tools": [
{
"toolSpec": {
"name": "<string>",
"description": "<string>",
"inputSchema": {
"json": {}
}
}
}
]
}
}
}
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions"
payload = {
"model": "nova:amazon.nova-lite-v1:0",
"messages": [{ "content": "<string>" }],
"temperature": 1,
"max_tokens": 1000,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"n": 1,
"stream": False,
"stop": "<string>",
"extra_body": { "metadata": { "toolConfig": { "tools": [{ "toolSpec": {
"name": "<string>",
"description": "<string>",
"inputSchema": { "json": {} }
} }] } } }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'nova:amazon.nova-lite-v1:0',
messages: [{content: '<string>'}],
temperature: 1,
max_tokens: 1000,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
n: 1,
stream: false,
stop: '<string>',
extra_body: {
metadata: {
toolConfig: {
tools: [
{toolSpec: {name: '<string>', description: '<string>', inputSchema: {json: {}}}}
]
}
}
}
})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions', 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://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'nova:amazon.nova-lite-v1:0',
'messages' => [
[
'content' => '<string>'
]
],
'temperature' => 1,
'max_tokens' => 1000,
'top_p' => 1,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'n' => 1,
'stream' => false,
'stop' => '<string>',
'extra_body' => [
'metadata' => [
'toolConfig' => [
'tools' => [
[
'toolSpec' => [
'name' => '<string>',
'description' => '<string>',
'inputSchema' => [
'json' => [
]
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions"
payload := strings.NewReader("{\n \"model\": \"nova:amazon.nova-lite-v1:0\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 1000,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"extra_body\": {\n \"metadata\": {\n \"toolConfig\": {\n \"tools\": [\n {\n \"toolSpec\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"inputSchema\": {\n \"json\": {}\n }\n }\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"nova:amazon.nova-lite-v1:0\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 1000,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"extra_body\": {\n \"metadata\": {\n \"toolConfig\": {\n \"tools\": [\n {\n \"toolSpec\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"inputSchema\": {\n \"json\": {}\n }\n }\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"nova:amazon.nova-lite-v1:0\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 1000,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"extra_body\": {\n \"metadata\": {\n \"toolConfig\": {\n \"tools\": [\n {\n \"toolSpec\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"inputSchema\": {\n \"json\": {}\n }\n }\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl_703da855e7e0415296d5365265a1b323",
"object": "chat.completion",
"created": 1767097779,
"model": "nova:amazon.nova-lite-v1:0",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a photo showing a yellow sign with \"AMENDMENT 35\" marking in the background, with a white room wall as the background and a curtain above. There are circular blue dots and white gear icons on the right side of the image. The photo may be from a game or simulation training device, with two fork spears on the right side of the image and a cursor mouse marker above the circular dot. The signs on the left and right sides have the number \"100\". The lower side has signs such as \"IDC, ANYMORE, AMMO 100\". The top and bottom of the photo are slightly blurred."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 739,
"output_token": 207,
"total_tokens": 946
}
}
Nova Image
Generate chat completions using Nova ILM model with image and text inputs.
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nova:amazon.nova-lite-v1:0",
"messages": [
{
"content": "<string>"
}
],
"temperature": 1,
"max_tokens": 1000,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"n": 1,
"stream": false,
"stop": "<string>",
"extra_body": {
"metadata": {
"toolConfig": {
"tools": [
{
"toolSpec": {
"name": "<string>",
"description": "<string>",
"inputSchema": {
"json": {}
}
}
}
]
}
}
}
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions"
payload = {
"model": "nova:amazon.nova-lite-v1:0",
"messages": [{ "content": "<string>" }],
"temperature": 1,
"max_tokens": 1000,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"n": 1,
"stream": False,
"stop": "<string>",
"extra_body": { "metadata": { "toolConfig": { "tools": [{ "toolSpec": {
"name": "<string>",
"description": "<string>",
"inputSchema": { "json": {} }
} }] } } }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'nova:amazon.nova-lite-v1:0',
messages: [{content: '<string>'}],
temperature: 1,
max_tokens: 1000,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
n: 1,
stream: false,
stop: '<string>',
extra_body: {
metadata: {
toolConfig: {
tools: [
{toolSpec: {name: '<string>', description: '<string>', inputSchema: {json: {}}}}
]
}
}
}
})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions', 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://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'nova:amazon.nova-lite-v1:0',
'messages' => [
[
'content' => '<string>'
]
],
'temperature' => 1,
'max_tokens' => 1000,
'top_p' => 1,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'n' => 1,
'stream' => false,
'stop' => '<string>',
'extra_body' => [
'metadata' => [
'toolConfig' => [
'tools' => [
[
'toolSpec' => [
'name' => '<string>',
'description' => '<string>',
'inputSchema' => [
'json' => [
]
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions"
payload := strings.NewReader("{\n \"model\": \"nova:amazon.nova-lite-v1:0\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 1000,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"extra_body\": {\n \"metadata\": {\n \"toolConfig\": {\n \"tools\": [\n {\n \"toolSpec\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"inputSchema\": {\n \"json\": {}\n }\n }\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"nova:amazon.nova-lite-v1:0\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 1000,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"extra_body\": {\n \"metadata\": {\n \"toolConfig\": {\n \"tools\": [\n {\n \"toolSpec\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"inputSchema\": {\n \"json\": {}\n }\n }\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"nova:amazon.nova-lite-v1:0\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 1000,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"extra_body\": {\n \"metadata\": {\n \"toolConfig\": {\n \"tools\": [\n {\n \"toolSpec\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"inputSchema\": {\n \"json\": {}\n }\n }\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl_703da855e7e0415296d5365265a1b323",
"object": "chat.completion",
"created": 1767097779,
"model": "nova:amazon.nova-lite-v1:0",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a photo showing a yellow sign with \"AMENDMENT 35\" marking in the background, with a white room wall as the background and a curtain above. There are circular blue dots and white gear icons on the right side of the image. The photo may be from a game or simulation training device, with two fork spears on the right side of the image and a cursor mouse marker above the circular dot. The signs on the left and right sides have the number \"100\". The lower side has signs such as \"IDC, ANYMORE, AMMO 100\". The top and bottom of the photo are slightly blurred."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 739,
"output_token": 207,
"total_tokens": 946
}
}
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)POST https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completionsImage Understanding (ILM) endpoints use the /iu path prefix. Video Understanding (VLM) endpoints use /vu instead.Supported Models
All models require thenova: prefix when used in the model parameter (e.g., nova:us.amazon.nova-lite-v1:0).
Amazon Nova Models
| Model | Input Price | Output Price |
|---|---|---|
| us.amazon.nova-premier-v1:0 | $2.50/1M tokens | $12.50/1M tokens |
| us.amazon.nova-pro-v1:0 | $0.80/1M tokens | $3.20/1M tokens |
| us.amazon.nova-2-lite-v1:0 | $0.33/1M tokens | $2.75/1M tokens |
| us.amazon.nova-lite-v1:0 | $0.06/1M tokens | $0.24/1M tokens |
- All prices are per 1,000,000 (1M) tokens
- Nova Premier offers the highest quality for complex multimodal tasks
- Nova Pro provides balanced performance and cost
- Nova 2 Lite and Nova Lite are optimized for cost-effective operations
- Remember to include the
nova:prefix:"model": "nova:us.amazon.nova-lite-v1:0"
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | - | The model to use (e.g., nova:us.amazon.nova-lite-v1:0) |
| messages | array | Yes | - | Array of message objects. Each message contains: - role: Role type, values: system, user, assistant- content: Message content, can be a string or array. Array items can contain:- type: Content type, text or image_url- text: Text content (when type is text)- image_url: Image URL or base64 encoded image (when type is image_url) |
| temperature | number | No | 1.0 | Controls randomness: 0.0-2.0, higher = more random |
| max_tokens | integer | No | 1000 | Maximum number of tokens to generate |
| top_p | number | No | 1.0 | Nucleus sampling: 0.0-1.0, consider tokens with top_p probability mass |
| frequency_penalty | number | No | 0.0 | Reduces repetition of frequent tokens: -2.0 to 2.0 |
| presence_penalty | number | No | 0.0 | Increases likelihood of new topics: -2.0 to 2.0 |
| n | integer | No | 1 | Number of completions to generate |
| stream | boolean | No | false | Whether to stream the response |
| stop | string | array | null | No | null | Stop sequences. Can be a string, array of strings, or null |
| extra_body | object | No | - | Additional body parameters. Contains: - metadata: Metadata object- toolConfig: Tool configuration- tools: Array of tool specifications |
Code Example
from openai import OpenAI
client = OpenAI(
api_key="sk-mavi-...",
base_url="https://mavi-backend.memories.ai/serve/api/v2/iu"
)
def call_my_ilm():
resp = client.chat.completions.create(
model="nova:us.amazon.nova-lite-v1:0",
messages=[
{"role": "system", "content": "You are a multimodal assistant. Keep your answers concise."},
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://storage.googleapis.com/memories-test-data/gun5.png"
# or use base64: "url": f"data:image/png;base64,{base64_string}"
}
},
{"type": "text", "text": "What is the content of this image?"}
]
}
],
temperature=1.0, # Controls randomness: 0.0-2.0, higher = more random
max_tokens=1000, # Maximum number of tokens to generate
top_p=1.0, # Nucleus sampling: 0.0-1.0, consider tokens with top_p probability mass
frequency_penalty=0.0, # -2.0 to 2.0, reduces repetition of frequent tokens
presence_penalty=0.0, # -2.0 to 2.0, increases likelihood of new topics
n=1, # Number of completions to generate
stream=False, # Whether to stream the response
stop=None, # Stop sequences (list of strings)
# extra_body={
# "metadata": {
# "toolConfig": {
# "tools": [
# {
# "toolSpec": {
# "name": "extract_image_summary",
# "description": "Extract a concise summary of the image",
# "inputSchema": {
# "json": {
# "type": "object",
# "properties": {
# "result": {"type": "string", "description": "Summary content."}
# },
# "required": ["result"]
# }
# }
# }
# }
# ]
# }
# }
# }
)
return resp
# Usage example
result = call_my_ilm()
print(result)
Response
Returns the chat completion response.{
"id": "chatcmpl_703da855e7e0415296d5365265a1b323",
"object": "chat.completion",
"created": 1767097779,
"model": "nova:amazon.nova-lite-v1:0",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a photo showing a yellow sign with \"AMENDMENT 35\" marking in the background, with a white room wall as the background and a curtain above. There are circular blue dots and white gear icons on the right side of the image. The photo may be from a game or simulation training device, with two fork spears on the right side of the image and a cursor mouse marker above the circular dot. The signs on the left and right sides have the number \"100\". The lower side has signs such as \"IDC, ANYMORE, AMMO 100\". The top and bottom of the photo are slightly blurred."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 739,
"output_token": 207,
"total_tokens": 946
}
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | Unique identifier for the chat completion |
| object | string | Object type, always “chat.completion” |
| created | integer | Unix timestamp of when the completion was created |
| model | string | The model used for the completion |
| choices | array | Array of completion choices |
| choices[].index | integer | Index of the choice in the choices array |
| choices[].message | object | Message object containing the assistant’s response |
| choices[].message.role | string | Role of the message, always “assistant” |
| choices[].message.content | string | Content of the message |
| choices[].finish_reason | string | Reason why the completion finished |
| usage | object | Token usage information |
| usage.prompt_tokens | integer | Number of tokens in the prompt |
| usage.output_token | integer | Number of tokens in the completion output |
| usage.total_tokens | integer | Total number of tokens used |
Authorizations
Body
The model to use (e.g., nova:amazon.nova-lite-v1:0)
"nova:amazon.nova-lite-v1:0"
Array of message objects
Show child attributes
Show child attributes
Controls randomness: 0.0-2.0, higher = more random
0 <= x <= 2Maximum number of tokens to generate
Nucleus sampling: 0.0-1.0
0 <= x <= 1Reduces repetition of frequent tokens: -2.0 to 2.0
-2 <= x <= 2Increases likelihood of new topics: -2.0 to 2.0
-2 <= x <= 2Number of completions to generate
Whether to stream the response
Stop sequences
Show child attributes
Show child attributes
Response
Chat completion response
Unique identifier for the chat completion
"chatcmpl_703da855e7e0415296d5365265a1b323"
Object type, always "chat.completion"
"chat.completion"
Unix timestamp of when the completion was created
1767097779
The model used for the completion
"nova:amazon.nova-lite-v1:0"
Array of completion choices
Show child attributes
Show child attributes
Token usage information
Show child attributes
Show child attributes
