> For the complete documentation index, see [llms.txt](https://nsclouds.gitbook.io/aillm.nscloud.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nsclouds.gitbook.io/aillm.nscloud.ai/conversation-apis/anthropic/messages.md).

# Messages

### 1. Overview

Anthropic exposes Messages protocol capabilities in this environment.

{% hint style="success" %}
This endpoint provides an Anthropic Messages-compatible path. Actual behavior depends on current supported capabilities.
{% endhint %}

**Supported models：**

* `claude-haiku-4-5-20251001`
* `claude-haiku-4.5`
* `claude-opus-4.5`
* `claude-opus-4.6`
* `claude-opus-4.7`
* `claude-opus-4.8`
* `claude-sonnet-4.5`
* `claude-sonnet-4.6`

### 2. API Details

## Create Message

> Provides an Anthropic Messages-compatible endpoint.

```json
{"openapi":"3.1.0","info":{"title":"NSCloud AI API Documentation","version":"1.11.0"},"tags":[{"name":"messages_anthropic","description":"Anthropic's Messages protocol API"}],"servers":[{"url":"https://aillm.nscloud.ai","description":"Global Server"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"http","scheme":"bearer","description":"Authenticate using Bearer token format: 'Bearer YOUR_SECRET_TOKEN'"}},"schemas":{"CreateMessagesRequest":{"type":"object","description":"Messages protocol request body.","properties":{"model":{"type":"string","description":"Model ID to invoke."},"messages":{"type":"array","description":"Input message list. Content parts are intentionally permissive to preserve vendor compatibility.","items":{"$ref":"#/components/schemas/MessagesRequestMessage"}},"max_tokens":{"type":"integer","description":"Maximum number of output tokens."},"stream":{"type":"boolean","description":"Whether to return the response as a stream.","default":false}},"required":["model","messages"],"additionalProperties":true},"MessagesRequestMessage":{"type":"object","description":"A single input message for Messages-compatible protocols.","properties":{"role":{"type":"string","description":"Message role. Different vendors may support different role names."},"content":{"description":"Message content, either plain text or an array of vendor-specific content parts.","oneOf":[{"type":"string","description":"Plain text content."},{"type":"array","description":"Structured content part array.","items":{"$ref":"#/components/schemas/MessageContentPart"}}]}},"required":["role","content"],"additionalProperties":true},"MessageContentPart":{"type":"object","description":"Flexible content part used by Messages-compatible protocols.","properties":{"type":{"type":"string","description":"Part type, such as text, image, tool_use, or tool_result."},"text":{"type":"string","description":"Text content when the part carries plain text."},"image_url":{"type":"object","description":"OpenAI-style image URL payload.","additionalProperties":true},"source":{"type":"object","description":"Anthropic-style media source payload.","additionalProperties":true},"id":{"type":"string","description":"Identifier for the content block or tool call."},"name":{"type":"string","description":"Name of the tool, function, or block."},"input":{"type":"object","description":"Tool input payload or other structured arguments.","additionalProperties":true},"content":{"description":"Nested content carried by some protocols, often for tool_result blocks.","oneOf":[{"type":"string","description":"Plain text nested content."},{"type":"array","description":"Nested structured content parts.","items":{"type":"object","additionalProperties":true}}]}},"additionalProperties":true},"MessageResponse":{"type":"object","description":"Messages protocol success response.","properties":{"id":{"type":"string","description":"Unique response ID."},"type":{"type":"string","description":"Object type, usually message."},"role":{"type":"string","description":"Role of the returned message, usually assistant."},"model":{"type":"string","description":"Model ID actually used for the request."},"content":{"type":"array","description":"Returned content parts. Vendors may include text, tool calls, citations, or reasoning blocks.","items":{"$ref":"#/components/schemas/MessageContentPart"}},"stop_reason":{"type":"string","description":"Reason generation stopped."},"usage":{"$ref":"#/components/schemas/Usage"}},"additionalProperties":true},"Usage":{"type":"object","description":"Token usage summary.","properties":{"prompt_tokens":{"type":"integer","description":"Number of input tokens consumed."},"completion_tokens":{"type":"integer","description":"Number of output tokens consumed."},"total_tokens":{"type":"integer","description":"Total number of tokens consumed."},"input_tokens":{"type":"integer","description":"Number of input tokens consumed for protocols that expose this field."},"output_tokens":{"type":"integer","description":"Number of output tokens consumed for protocols that expose this field."},"completion_tokens_details":{"type":"object","description":"Optional breakdown of completion token usage.","properties":{"reasoning_tokens":{"type":"integer","description":"Tokens consumed by reasoning or chain-of-thought style generation."}},"additionalProperties":true},"input_tokens_details":{"type":"object","description":"Optional breakdown of input token usage.","properties":{"text_tokens":{"type":"integer","description":"Input tokens attributed to text."},"image_tokens":{"type":"integer","description":"Input tokens attributed to images."}},"additionalProperties":true}}},"ErrorResponse":{"type":"object","description":"Error response payload.","properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","description":"Error detail object.","properties":{"message":{"type":"string","description":"Human-readable error message."},"type":{"type":"string","description":"Error type."},"param":{"description":"Parameter associated with the error, if any.","type":["string","null"]},"code":{"description":"Machine-readable error code, if any.","type":["string","null"]}}}},"responses":{"ErrorResponse":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v1/messages":{"post":{"tags":["messages_anthropic"],"summary":"Create Message","description":"Provides an Anthropic Messages-compatible endpoint.","operationId":"createMessage_anthropic","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessagesRequest"}}}},"responses":{"200":{"description":"Success Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"$ref":"#/components/responses/ErrorResponse"},"401":{"$ref":"#/components/responses/ErrorResponse"},"429":{"$ref":"#/components/responses/ErrorResponse"}}}}}}
```
