API reference
Messages (Anthropic format)
Models on this endpoint (5)
POST
/v1/messagesAnthropic’s native wire format, served with the same bearer key. Claude Code and the official anthropic SDKs work by only changing the base URL — no adapter, no shape translation.
#Request parameters
modelstringrequiredA Claude model ID from the models page, e.g. claude-opus-5-5.
max_tokensintegerrequiredRequired by the Anthropic shape — the hard output cap.
messagesarrayrequiredAnthropic-style turns: {role: user|assistant, content}.
systemstringoptionalSystem prompt — a top-level field here, not a message role.
streambooleanoptionalStreams Anthropic-native SSE events (message_start, content_block_delta, …).
temperaturenumberoptional0 to 1 in the Anthropic scale.
toolsarrayoptionalAnthropic tool definitions; tool_use blocks come back in content.
anthropic-version header
Send anthropic-version: 2023-06-01 like the official API expects. Authorization: Bearer works here; x-api-key is also accepted for stock Anthropic SDKs.
#Related errors
- 400 invalid_request_errorMalformed body or unsupported parameter for this model.
- 401Invalid or missing bearer token. No error.code on this path — match the status.
- 402 insufficient_user_quotaWallet balance cannot cover the pre-reserved estimate.
- 429Per-key throttle. Empty body; wait for Retry-After. A 429 that does carry insufficient_user_quota is a daily spend cap instead.
- 503 model_not_foundUnknown model, or no healthy channel serves it right now.
#Request example
curl https://www.aisplice.store/v1/messages \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Say hello."}]
}'#Response
response.json
{
"id": "msg_…",
"type": "message",
"role": "assistant",
"model": "claude-opus-5-5",
"content": [{"type": "text", "text": "Hello!"}],
"stop_reason": "end_turn",
"usage": {"input_tokens": 10, "output_tokens": 5}
}Still stuck?
Send us the request ID or the error message and we will look into it.