Claude-compatible API
For the official Claude SDK, Claude Code, and other clients that speak the Anthropic Messages format.
text
POST https://uni.sointech.com.cn/v1/messagesThis is not chat completions. Chat completions use OpenAI's /v1/chat/completions. Claude clients should use this API. Use a Claude model name published on the site, such as claude-sonnet-4-6. The catalog is the list that matters.
Request
Send either key header:
| Header | Value |
|---|---|
x-api-key | sk-your-token |
Authorization | Bearer sk-your-token |
anthropic-version | 2023-06-01 |
Content-Type | application/json |
Common body fields:
| Field | Meaning |
|---|---|
model | Claude model name |
max_tokens | Maximum tokens to generate. This format requires the field |
messages | Array of messages with role and content |
stream | Optional. true returns a server-sent event stream |
bash
curl https://uni.sointech.com.cn/v1/messages \
-H "x-api-key: sk-your-token" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d "{\"model\":\"claude-sonnet-4-6\",\"max_tokens\":1024,\"messages\":[{\"role\":\"user\",\"content\":\"Introduce yourself in one sentence\"}]}"Response
Text is in the content array. Read content[0].text for a text block. Usage is in usage. The charge still follows that model's rule in the catalog.
SDK
Set base_url to the site origin. The SDK requests /v1/messages itself.
python
import anthropic
client = anthropic.Anthropic(
api_key="sk-your-token",
base_url="https://uni.sointech.com.cn",
)
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Introduce yourself in one sentence"}],
)
print(message.content[0].text)Install the package with pip install anthropic.
Claude Code uses the same origin:
bash
export ANTHROPIC_BASE_URL=https://uni.sointech.com.cn
export ANTHROPIC_API_KEY=sk-your-tokenIf the request URL becomes /v1/v1/messages, remove the extra /v1 from base_url.
