SilentAPI Logo SilentAPI

Anthropic Style

Use the Anthropic Messages API format

SilentAPI provides an endpoint compatible with the Anthropic Messages API at /v1/messages. Point the Anthropic SDK at SilentAPI and send your API key.

Endpoint

MethodPathDescription
POST/v1/messagesCreate a message (Anthropic Messages API)

Basic Request

curl https://api.silentapi.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-5.5",
    "max_tokens": 1024,
    "messages": [{"role":"user","content":"What is zero data retention (ZDR)?"}]
  }'

Response:

{
  "id": "msg_1719584000",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-5.5",
  "content": [{
    "type": "text",
    "text": "Zero data retention means no prompts or outputs are kept."
  }],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 7,
    "output_tokens": 89
  },
  "silentapi": {
    "cost": 0.000084,
    "fallback": null
  }
}

Using the Anthropic SDK

Python

import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://api.silentapi.com"
)

message = client.messages.create(
    model="claude-sonnet-5.5",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Explain quantum computing"}
    ]
)
print(message.content[0].text)

TypeScript

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
    apiKey: "YOUR_API_KEY",
    baseURL: "https://api.silentapi.com"
});

const message = await client.messages.create({
    model: "claude-sonnet-5.5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Explain quantum computing" }]
});
const responseText = message.content[0].text;

Supported Parameters

ParameterTypeDescription
modelstringA supported text or multimodal model ID
messagesarrayMulti-turn conversation messages
systemstringSystem instruction
max_tokensintegerMaximum output tokens (required by Anthropic API)
temperaturenumberSampling temperature
top_pnumberNucleus sampling parameter
stop_sequencesarraySequences that stop generation
toolsarrayFunction definitions with name and input_schema
tool_choiceobjectSelect auto, any, none, or a named tool
thinkingobjectThinking configuration. See Reasoning.
streambooleanEnable SSE streaming (see Streaming)

Reasoning

Send thinking with type: "enabled". SilentAPI changes budget_tokens to a reasoning level:

budget_tokensReasoning level
Absentmedium
1 to 2,048low
2,049 to 8,192medium
8,193 to 32,768high
32,769 to 65,536xhigh
More than 65,536max

Each model supports its own set of levels. SilentAPI changes an unsupported level to the closest supported level. See Reasoning for the rules.

Parameter Handling

RequestHandling
thinking.type: "disabled"Level none. Reasoning is off on models that can turn it off. Other models use their lowest level.
thinking.type: "adaptive" without budget_tokensLevel medium
output_config.effortUsed as the level: low, medium, high, xhigh, or max. It wins over budget_tokens. thinking.type: "disabled" wins over it.
budget_tokens on any modelChanged to a level with the table above, then to the closest level the model supports
temperature above 2Limited to 2. See Parameter Handling.
curl https://api.silentapi.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "model": "claude-sonnet-5.5",
    "max_tokens": 4096,
    "thinking": {"type": "enabled", "budget_tokens": 4096},
    "messages": [{"role":"user","content":"Compare two sorting algorithms."}]
  }'

Cross-Style Usage

Use any supported text or multimodal model with the Anthropic Messages API. The response uses the Anthropic Messages format.

Streaming

Set stream: true to receive server-sent events (SSE) in the Anthropic Messages API format. See Streaming for the event sequence.