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 as claude-sonnet-4, claude-opus-4.6, claude-haiku-4.5
  • messages (array, required) — Array with role ("user" or "assistant") and content
  • max_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 blocks
  • stream (boolean, optional) — Enable streaming via Anthropic SSE format
  • temperature (number, optional) — Sampling temperature (0.0–1.0)
  • top_p (number, optional) — Nucleus sampling threshold
  • top_k (integer, optional) — Top-K sampling parameter
  • stop_sequences (array, optional) — Array of stop sequences
  • tools (array, optional) — Anthropic-format tool definitions
  • tool_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
Docs Assistant
I’m here to help with NavyAI docs. Ask about endpoints, auth, models, request bodies, or integration details.