Skip to documentation

Anthropic Messages

Text and tool blocks using the documented Messages protocol subset.

Updated October 31, 2026 · Contract 0.2.0

POST/v1/messages

Request contract

Supply the current anthropic-version header and max_tokens. Use user/assistant text plus top-level system text. The adapter also accepts bounded system-role text. This protocol serves NotHoly models, not Claude weights.

Tools and result order

Assistant tool_use blocks pair with user tool_result blocks. Results precede new user text. Assistant text after tool-use blocks is unsupported to avoid silently reordering content. The caller executes functions.

Incremental native streaming

The stream sends message_start, indexed content_block_start/delta/stop events, message_delta and successful message_stop. Text and validated tool-argument progress arrive while generation is running. An error emits a native error event without a false successful terminal event. Official SDK accumulators reconstruct the result.

Unsupported features

Images, documents, cache controls, thinking controls, server tools, stop sequences, sampling and explicit parallel-control options are rejected. Supported provider-visible thinking uses an empty signature and x-notholy-thinking-signature: unavailable; no Claude integrity signature is fabricated. Only these unsigned assistant blocks can round-trip. Ordinary input usage excludes cache-read tokens.

Request example

Use your customer key and a published model. Copying an example does not send a request.

curl
curl https://api.notholy.com/v1/messages \
  -H "Authorization: Bearer $NOTHOLY_API_KEY" \
  -H "anthropic-version: 2026-10-21" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "notholy-pulse",
  "messages": [
    {
      "role": "user",
      "content": "Explain least privilege."
    }
  ],
  "max_tokens": 256
}'

HTTP contract fixture. Fixture checks are separate from live model availability.

Request fields

Generated from the versioned contract. Refinement rules above still apply.

systemstring | array<object>

Show accepted variants
Variant 1string

Up to 1,048,576 characters.

Variant 2array<object>

Up to 128 items.

Show item fields
type"text"required

textstringrequired

Up to 1,048,576 characters.

modelstringrequired

Up to 100 characters.

max_tokensintegerrequired

Minimum 1. Maximum 512,000.

messagesarray<object>required

Up to 128 items. At least 1 item.

Show item fields
role"user" | "assistant" | "system"required

contentstring | array<object | object | object | object>required

Show accepted variants
Variant 1string

Up to 1,048,576 characters.

Variant 2array<object | object | object | object>

Up to 128 items. At least 1 item.

streamboolean

toolsarray<object>

Up to 8 items.

Show item fields
namestringrequired

descriptionstring

Up to 1,000 characters.

input_schemaobjectrequired

Show object fields
type"object"required

propertiesobject

requiredarray<string>

additionalPropertiesboolean

tool_choiceobject | object

Show accepted variants
Variant 1object

Unknown fields rejected.

Show object fields
type"auto" | "any" | "none"required

Variant 2object

Unknown fields rejected.

Show object fields
type"tool"required

namestringrequired

Response schema

idstringrequired

type"message"required

role"assistant"required

contentarray<object | object | object>required

modelstringrequired

stop_reason"end_turn" | "tool_use" | "max_tokens" | nullrequired

stop_sequencenullrequired

usageobjectrequired

Unknown fields rejected.

Show object fields
input_tokensintegerrequired

Minimum 0. Maximum 9,007,199,254,740,991.

output_tokensintegerrequired

Minimum 0. Maximum 9,007,199,254,740,991.

cache_creation_input_tokensintegerrequired

Minimum 0. Maximum 9,007,199,254,740,991.

cache_read_input_tokensintegerrequired

Minimum 0. Maximum 9,007,199,254,740,991.