> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Nova Image

> Generate chat completions using Nova ILM model with image and text inputs.

<Info>
  **Product**: Visual Intelligence — Image Model APIs (atomic)
  **Use case**: Call an Image Language Model (Gemini / GPT / Nova / Qwen) directly with your own prompt. Full control over model and parameters.
  **Host**: `https://mavi-backend.memories.ai/serve/api/v2`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

This endpoint allows you to generate chat completions with image and text inputs using Nova ILM model.

<Info>
  **Endpoint:** `POST https://mavi-backend.memories.ai/serve/api/v2/iu/chat/completions`

  Image Understanding (ILM) endpoints use the `/iu` path prefix. Video Understanding (VLM) endpoints use `/vu` instead.
</Info>

## Supported Models

All models require the `nova:` 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  |

<Note>
  **Pricing Notes:**

  * 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"`
</Note>

### 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:<br />- `role`: Role type, values: `system`, `user`, `assistant`<br />- `content`: Message content, can be a string or array. Array items can contain:<br />  - `type`: Content type, `text` or `image_url`<br />  - `text`: Text content (when type is text)<br />  - `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:<br />- `metadata`: Metadata object<br />  - `toolConfig`: Tool configuration<br />    - `tools`: Array of tool specifications                                                                                                                                                                                                                             |

### Code Example

<CodeGroup>
  ```python Python theme={null}
  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)
  ```
</CodeGroup>

### Response

Returns the chat completion response.

<ResponseExample>
  ```json theme={null}
  {
    "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
    }
  }
  ```
</ResponseExample>

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


## OpenAPI

````yaml visual-intelligence/nova/openapi.json  POST /iu/chat/completions
openapi: 3.1.0
info:
  title: Nova API Reference
  description: REST APIs for Nova ILM and VLM models
  version: v1.0.0
servers:
  - url: https://mavi-backend.memories.ai/serve/api/v2
security:
  - ApiKeyAuth: []
paths:
  /iu/chat/completions:
    post:
      summary: Chat Completions Nova ILM
      description: >-
        Generate chat completions using Nova ILM or VLM models with image and
        video inputs.
      operationId: chat_completions_nova_ilm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: The model to use (e.g., nova:amazon.nova-lite-v1:0)
                  example: nova:amazon.nova-lite-v1:0
                messages:
                  type: array
                  description: Array of message objects
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - text
                                    text:
                                      type: string
                                  required:
                                    - type
                                    - text
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - image_url
                                    image_url:
                                      type: string
                                  required:
                                    - type
                                    - image_url
                    required:
                      - role
                      - content
                temperature:
                  type: number
                  description: 'Controls randomness: 0.0-2.0, higher = more random'
                  minimum: 0
                  maximum: 2
                  default: 1
                max_tokens:
                  type: integer
                  description: Maximum number of tokens to generate
                  default: 1000
                top_p:
                  type: number
                  description: 'Nucleus sampling: 0.0-1.0'
                  minimum: 0
                  maximum: 1
                  default: 1
                frequency_penalty:
                  type: number
                  description: 'Reduces repetition of frequent tokens: -2.0 to 2.0'
                  minimum: -2
                  maximum: 2
                  default: 0
                presence_penalty:
                  type: number
                  description: 'Increases likelihood of new topics: -2.0 to 2.0'
                  minimum: -2
                  maximum: 2
                  default: 0
                'n':
                  type: integer
                  description: Number of completions to generate
                  default: 1
                stream:
                  type: boolean
                  description: Whether to stream the response
                  default: false
                stop:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                    - type: 'null'
                  description: Stop sequences
                extra_body:
                  type: object
                  properties:
                    metadata:
                      type: object
                      properties:
                        toolConfig:
                          type: object
                          properties:
                            tools:
                              type: array
                              items:
                                type: object
                                properties:
                                  toolSpec:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      description:
                                        type: string
                                      inputSchema:
                                        type: object
                                        properties:
                                          json:
                                            type: object
              required:
                - model
                - messages
      responses:
        '200':
          description: Chat completion response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the chat completion
                    example: chatcmpl_703da855e7e0415296d5365265a1b323
                  object:
                    type: string
                    description: Object type, always "chat.completion"
                    example: chat.completion
                  created:
                    type: integer
                    description: Unix timestamp of when the completion was created
                    example: 1767097779
                  model:
                    type: string
                    description: The model used for the completion
                    example: nova:amazon.nova-lite-v1:0
                  choices:
                    type: array
                    description: Array of completion choices
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          description: Index of the choice in the choices array
                        message:
                          type: object
                          description: Message object containing the assistant's response
                          properties:
                            role:
                              type: string
                              enum:
                                - assistant
                              description: Role of the message, always "assistant"
                            content:
                              type: string
                              description: Content of the message
                              example: >-
                                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.
                        finish_reason:
                          type: string
                          description: Reason why the completion finished
                  usage:
                    type: object
                    description: Token usage information
                    properties:
                      prompt_tokens:
                        type: integer
                        description: Number of tokens in the prompt
                        example: 739
                      output_token:
                        type: integer
                        description: Number of tokens in the completion output
                        example: 207
                      total_tokens:
                        type: integer
                        description: Total number of tokens used
                        example: 946
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````