Documentation
Messages (Anthropic)
POST /v1/messages is the Anthropic-compatible endpoint for Claude-native apps and agent flows. Perfect for use with the official Anthropic SDK, Claude Code, Cline, and other tools that speak the Anthropic protocol directly.
Use it when
- Your code already targets the Anthropic Messages API
- You need Anthropic-style request and response objects
- You want Claude-native tooling and streaming behavior
Code examples
1curl -X POST https://api.navy/v1/messages \
2 -H "x-api-key: sk-navy-YOUR_KEY" \
3 -H "Content-Type: application/json" \
4 -H "anthropic-version: 2023-06-01" \
5 -d '{
6 "model": "claude-sonnet-4-20250514",
7 "max_tokens": 1024,
8 "messages": [
9 {"role": "user", "content": "Draft a deployment checklist."}
10 ]
11 }'Parameters
model(string, required) — Anthropic model ID such asclaude-sonnet-4,claude-opus-4.6,claude-haiku-4.5messages(array, required) — Array withrole("user"or"assistant") andcontentmax_tokens(integer, required) — Maximum tokens to generate (required by Anthropic format)system(string or array, optional) — System prompt as a string or array of text blocksstream(boolean, optional) — Enable streaming via Anthropic SSE formattemperature(number, optional) — Sampling temperature (0.0–1.0)top_p(number, optional) — Nucleus sampling thresholdtop_k(integer, optional) — Top-K sampling parameterstop_sequences(array, optional) — Array of stop sequencestools(array, optional) — Anthropic-format tool definitionstool_choice(object, optional) —{ type: "auto" },{ type: "any" }, or{ type: "tool", name: "..." }
Authentication
This endpoint accepts your NavyAI API key via either header:
x-api-key: sk-navy-YOUR_KEY(Anthropic style)Authorization: Bearer sk-navy-YOUR_KEY(OpenAI style)
Notes
- This endpoint is designed for Anthropic-native clients
- Streaming uses Anthropic SSE formatting
- Vision and tools are supported in the native shape