Console

Create Message (Messages)

POST/v1/messages

Call Nex N2.6 using the Anthropic Messages format. Send the x-api-key: <API Key>, anthropic-version: 2023-06-01, and Content-Type: application/json headers.

Production HTTP requests use https://api.mosi.cn. Before running the examples below, set MOSS_API_ORIGIN to https://api.mosi.cn and MOSS_API_KEY to your MOSS API Key.

Request parameters

FieldTypeUsageDescription
model: stringRequired

Use nex-n2.6 or the pinned snapshot nex-n2.6-2026-11-05.

messages: array<object>Required

Pass the conversation messages and relevant history.

messages[].role: stringRequired

Use user or assistant. Send tool results in a user message.

messages[].content: string or arrayRequired

Use a string for text-only input. For images, use a content block with type: image and a URL or Base64 source. Messages does not support video.

max_tokens: integerProvide

Output token budget. The production default is 8192, and the parameter maximum is 131072. The examples pass 1024 explicitly.

stream: booleanOptional

Set to true to stream the response.

tools: array<object>Optional

Supports function tools executed by the client.

version: stringOptional

Optional. If supplied, use 2026-11-05 and make sure it matches the snapshot selected by model.

Response fields

FieldTypeDescription
model: string

ID of the snapshot used to generate this response.

content: array<object>

Read text from blocks with type set to text. Tool call blocks have type set to tool_use.

stop_reason: string or null

Stop reason. tool_use indicates that the client needs to execute a tool.

usage: object

Usage for this generation.

Anthropic client integration

Send requests to https://api.mosi.cn/v1/messages. Pass your MOSS API key in x-api-key and set anthropic-version: 2023-06-01.