接口说明
文本系列接口,原生兼容 Anthropic。你可以直接使用 Anthropic 官方 SDK 进行调用。配置信息
- 基础地址 (Base URL):
https://api.nonelinear.com/anthropic
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
使用 NoneLinear API 创建 Anthropic 兼容的对话请求
https://api.nonelinear.com/anthropicimport anthropic
client = anthropic.Anthropic(
base_url="https://api.nonelinear.com/anthropic",
api_key="YOUR_NONELINEAR_API_KEY",
)
message = client.messages.create(
model="claude-haiku-4.5",
messages=[
{"role": "user", "content": "你好,请介绍一下你自己。"}
]
)
print(message.content)
curl -sS https://api.nonelinear.com/anthropic/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-4.5",
"max_tokens": 32,
"messages": [
{
"role": "user",
"content": "只回复 OK"
}
]
}'