POST
/
ilm
/
chat
/
completions
Chat Completions qwen ilm
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/ilm/chat/completions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "qwen:qwen3-vl-plus",
  "messages": [
    {
      "role": "system",
      "content": "<string>"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 1024,
  "top_p": 0.9,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "n": 1,
  "stream": false,
  "stop": "<string>",
  "extra_body": {
    "metadata": {
      "enable_thinking": true,
      "thinking_budget": 123,
      "response_format": {
        "type": "json_schema",
        "json_schema": {
          "name": "<string>",
          "schema": {
            "type": "object",
            "properties": {},
            "required": [
              "<string>"
            ]
          }
        }
      }
    }
  }
}
'
{
  "id": "6612267a-d08f-9ea0-a254-7bcea6339f49",
  "object": "completion",
  "model": "qwen3-vl-plus",
  "created_at": 1767094289,
  "status": "completed",
  "choices": [
    {
      "text": "This image is from the game Half-Life 2, showing a game scene from a first-person perspective.\n\nIn the scene, the player holds a \"Gravity Gun\" in each hand, aiming at the wall ahead. A yellow \"Mandatory Reminder\" sign hangs on the wall, printed with the U.S. national emblem pattern and inscribed with \"AMENDMENT 35\" (35th Amendment), with text below reading: \"No person shall be found with fewer than thirteen times their own body weight of federally provisioned munitions.\" - This is clearly a fictional absurd law within the game.\n\nThe bottom left corner of the screen shows the player's \"HEALTH\" and \"SUIT\" both at 100. The bottom right corner displays ammunition information \"IDC ANYMORE AMMO\", suggesting ample or infinite ammunition.\n\nThe entire scene is full of dark humor and dystopian style, one of the iconic scenes from Half-Life 2, often used by players as memes or screenshots for sharing.",
      "index": 0
    }
  ],
  "usage": {
    "input_tokens": 235,
    "output_tokens": 229,
    "total_tokens": 464
  },
  "meta": {
    "provider": "qwen",
    "provider_model": "qwen3-vl-plus"
  }
}
This endpoint allows you to generate chat completions with image inputs using Qwen ILM model.

Request Body

ParameterTypeRequiredDefaultDescription
modelstringYes-The model to use (e.g., qwen:qwen3-vl-plus)
messagesarrayYes-Array of message objects. Each message contains:
- role: Role type, values: system, user
- content: Message content, can be a string or array. Array items can contain:
- image: Image URL or base64 encoded image
- text: Text content
temperaturenumberNo0.7Controls randomness: 0.0-2.0, higher = more random
max_tokensintegerNo1024Maximum number of tokens to generate
top_pnumberNo0.9Nucleus sampling: 0.0-1.0, consider tokens with top_p probability mass
frequency_penaltynumberNo0.0Reduces repetition of frequent tokens: -2.0 to 2.0
presence_penaltynumberNo0.0Increases likelihood of new topics: -2.0 to 2.0
nintegerNo1Number of completions to generate
streambooleanNofalseWhether to stream the response
stopstring | array | nullNonullStop sequences. Can be a string, array of strings, or null
extra_bodyobjectNo-Additional body parameters. Contains:
- metadata: Metadata object
- enable_thinking: Boolean to enable thinking mode
- thinking_budget: Integer value for thinking budget
- response_format: Response format configuration
- type: Format type (json_schema)
- json_schema: JSON schema object
- name: Schema name
- schema: JSON schema definition

Code Example

from openai import OpenAI

client = OpenAI(
    api_key="sk-8483027fe3abfe535f6ae01a9979b4f7",
    base_url="https://mavi-backend.memories.ai/serve/api/v2/ilm"
)

resp = client.chat.completions.create(
    model="qwen:qwen3-vl-plus",
    messages=[
        {"role": "system", "content": "You are a multimodal assistant. Keep your answers concise."},
        {
            "role": "user",
            "content": [
                {
                    "image": "https://storage.googleapis.com/memories-test-data/gun5.png"  # url or base64
                },
                {"text": "What is the content of this image?"}
            ]
        }
    ],
    temperature=0.7,  # Controls randomness: 0.0-2.0, higher = more random
    max_tokens=1024,  # Maximum number of tokens to generate
    top_p=0.9,  # 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": {
            "enable_thinking": True,
            "thinking_budget": 1024,
            "response_format": {
                "type": "json_schema",
                "json_schema": {
                    "name": "answer",
                    "schema": {
                        "type": "object",
                        "properties": {
                            "result": {"type": "string"}
                        },
                        "required": ["result"]
                    }
                }
            }
        }
    }
)
print(resp)

Response

Returns the chat completion response with structured output.
{
  "id": "6612267a-d08f-9ea0-a254-7bcea6339f49",
  "object": "completion",
  "model": "qwen3-vl-plus",
  "created_at": 1767094289,
  "status": "completed",
  "choices": [
    {
      "text": "This image is from the game Half-Life 2, showing a game scene from a first-person perspective.\n\nIn the scene, the player holds a \"Gravity Gun\" in each hand, aiming at the wall ahead. A yellow \"Mandatory Reminder\" sign hangs on the wall, printed with the U.S. national emblem pattern and inscribed with \"AMENDMENT 35\" (35th Amendment), with text below reading: \"No person shall be found with fewer than thirteen times their own body weight of federally provisioned munitions.\" - This is clearly a fictional absurd law within the game.\n\nThe bottom left corner of the screen shows the player's \"HEALTH\" and \"SUIT\" both at 100. The bottom right corner displays ammunition information \"IDC ANYMORE AMMO\", suggesting ample or infinite ammunition.\n\nThe entire scene is full of dark humor and dystopian style, one of the iconic scenes from Half-Life 2, often used by players as memes or screenshots for sharing.",
      "index": 0
    }
  ],
  "usage": {
    "input_tokens": 235,
    "output_tokens": 229,
    "total_tokens": 464
  },
  "meta": {
    "provider": "qwen",
    "provider_model": "qwen3-vl-plus"
  }
}

Response Parameters

ParameterTypeDescription
idstringUnique identifier for the completion
objectstringObject type, always “completion”
modelstringThe model used for the completion
created_atintegerUnix timestamp of when the completion was created
statusstringStatus of the completion (e.g., “completed”)
choicesarrayArray of completion choices
choices[].textstringText content of the completion
choices[].indexintegerIndex of the choice in the choices array
usageobjectToken usage information
usage.input_tokensintegerNumber of input tokens used
usage.output_tokensintegerNumber of output tokens generated
usage.total_tokensintegerTotal number of tokens used
metaobjectMetadata about the completion
meta.providerstringProvider name (e.g., “qwen”)
meta.provider_modelstringProvider-specific model name

Authorizations

Authorization
string
header
required

Body

application/json
model
string
required

The model to use (e.g., qwen:qwen3-vl-plus)

Example:

"qwen:qwen3-vl-plus"

messages
object[]
required

Array of message objects

temperature
number
default:0.7

Controls randomness: 0.0-2.0, higher = more random

Required range: 0 <= x <= 2
max_tokens
integer
default:1024

Maximum number of tokens to generate

top_p
number
default:0.9

Nucleus sampling: 0.0-1.0

Required range: 0 <= x <= 1
frequency_penalty
number
default:0

Reduces repetition of frequent tokens: -2.0 to 2.0

Required range: -2 <= x <= 2
presence_penalty
number
default:0

Increases likelihood of new topics: -2.0 to 2.0

Required range: -2 <= x <= 2
n
integer
default:1

Number of completions to generate

stream
boolean
default:false

Whether to stream the response

stop

Stop sequences

extra_body
object

Response

200 - application/json

Chat completion response with structured output

id
string
required

Unique identifier for the completion

Example:

"6612267a-d08f-9ea0-a254-7bcea6339f49"

object
string
required

Object type, always 'completion'

Example:

"completion"

model
string
required

The model used for the completion

Example:

"qwen3-vl-plus"

created_at
integer
required

Unix timestamp of when the completion was created

Example:

1767094289

status
string
required

Status of the completion

Example:

"completed"

choices
object[]
required
usage
object
required
meta
object
required