---
title: "Create message"
method: POST
path: "/2/ai/{product_id}/anthropic/v1/messages"
tags: ["Usage > V2 > Anthropic-compatible"]
---

# Create message

`POST /2/ai/{product_id}/anthropic/v1/messages`

Anthropic (Claude) compatible endpoint to create a message, see the [Claude documentation](https://platform.claude.com/docs/en/api/messages/create).
<br><br>
List of models available on this endpoint could be retrieve with [GET `/2/ai/{product_id}/anthropic/v1/models`](/docs/api/get/2/ai/{product_id}/anthropic/v1/models).
<br><br>
Some models are in **beta** and may being subject to changes,
use [GET `/1/ai/models`](/docs/api/get/1/ai/models) to check what model are in **beta**
and see our [General Terms and Conditions](https://www.infomaniak.com/gtl/rgpd.documents).

## Path parameters

- `product_id` integer, required

## Request body

- object
  - `max_tokens` integer, required — The maximum number of tokens to generate before stopping.<br><br>Note that our models may stop <i>before</i> reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
  - `messages` object[], required — Input messages.<br><br>Our models are trained to operate on alternating <code>user</code> and <code>assistant</code> conversational turns. When creating a new Message, you specify the prior conversational turns with the <code>messages</code> parameter, and the model then generates the next Message in the conversation.<br><br>Each input message must be an object with a <code>role</code> and <code>content</code>. You can specify a single <code>user</code>-role message, or you can include multiple <code>user</code> and <code>assistant</code> messages.
    - `content` string, required — The content of the message. May be a single string or an array of content blocks.<br>A string is shorthand for an array of one content block of type <code>text</code>.
    - `role` 'assistant' | 'user', required — The role of the message.
  - `metadata` object — An object describing metadata about the request.
    - `user_id` string — An external identifier for the user who is associated with the request. This should be a uuid, hash value, or other opaque identifier.
  - `model` string, required — Model name to use<br>You can use the endpoint [GET `/2/ai/{product_id}/anthropic/v1/models`](/docs/api/get/2/ai/%7Bproduct_id%7D/anthropic/v1/models) to see all our available models with various information.
  - `stop_sequences` string[] — Custom text sequences that will cause the model to stop generating.<br><br>Our models will normally stop when they have naturally completed their turn, which will result in a response <code>stop_reason</code> of <code>"end_turn"</code>.
  - `stream` boolean — Whether to incrementally stream the response using server-sent events.<br><br>**Defaults to <code>false</code>**
  - `system` string, nullable — System prompt.<br>A system prompt is a way of providing context and instructions to the model, such as specifying a particular goal or role. May be a single string or an array of text blocks.
  - `temperature` number, double — Amount of randomness injected into the response.<br><br>**Defaults to <code>1.0</code>**<br>Ranges from <code>0.0</code> to <code>1.0</code>. Use <code>temperature</code> closer to <code>0.0</code> for analytical / multiple choice, and closer to <code>1.0</code> for creative and generative tasks.<br><br>Note that even with <code>temperature</code> of <code>0.0</code>, the results will not be fully deterministic.
  - `thinking` object — Configuration for enabling the model's extended thinking.<br><br>When enabled, responses include <code>thinking</code> content blocks showing the model's thinking process before the final answer.
    - `budget_tokens` integer — Determines how many tokens the model can use for its internal reasoning process. Must be >= 1024 and less than <code>max_tokens</code>.
    - `type` 'adaptive' | 'disabled' | 'enabled' — The type of thinking configuration.
  - `tool_choice` unknown[] — How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.<br><br>Use <code>{"type": "auto"}</code> to let the model decide, <code>{"type": "any"}</code> to force any tool, <code>{"type": "tool", "name": "my_tool"}</code> to force a specific tool, or <code>{"type": "none"}</code> to prevent tool use.
    - unknown
  - `tools` object[] — Definitions of tools that the model may use.<br><br>Each tool definition includes a <code>name</code>, an optional <code>description</code>, and an <code>input_schema</code> (JSON schema) for the tool input shape that the model will produce in <code>tool_use</code> output content blocks.
    - `description` string — Description of what the tool does.
    - `input_schema` unknown[], required — JSON schema for this tool's input. This defines the shape of the <code>input</code> that your tool accepts and that the model will produce.
      - unknown
    - `name` string, required — Name of the tool.

## Response `200`

OK

- 4cee7ea0AnthropicV1Messages — Anthropic response format of /v1/messages
  - `id` string, required — Unique object identifier.
  - `type` string, required — The object type, which is always `message`.
  - `role` string, required — The conversational role of the generated message, which is always `assistant`.
  - `content` 4cee7ea0AnthropicV1MessagesContentBlock[], required
    - `type` string, required — The content block type.
    - `text` string, nullable, required — The text content (for `text` type blocks).
    - `id` string, nullable, required — The tool use ID (for `tool_use` type blocks).
    - `name` string, nullable, required — The tool name (for `tool_use` type blocks).
    - `input` string, nullable, required — The tool input as a JSON object (for `tool_use` type blocks).
    - `thinking` string, nullable, required — The thinking text (for `thinking` type blocks).
    - `signature` string, nullable, required — The signature for the thinking block (for `thinking` type blocks).
  - `model` string, required — The model that handled the request.
  - `stop_reason` string, nullable, required — The reason the model stopped generating.
  - `stop_sequence` string, nullable, required — The custom stop sequence that caused the model to stop, if applicable.
  - `usage` 4cee7ea0AnthropicV1MessagesUsage, required — Usage statistics for the messages request.
    - `input_tokens` integer, required — Number of tokens in the input.
    - `output_tokens` integer, required — Number of tokens in the generated output.

## Changes

- **2026-09-15** `a32e6ecd4d09` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/changes/2/ai/:product_id/anthropic/v1/messages/post.md)

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/revisions/64c14a5addb7?raw)
