aisplice

API reference

Messages (Anthropic format)

POST/v1/messages

Anthropic’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

  • modelstringrequired

    A Claude model ID from the models page, e.g. claude-opus-5-5.

  • max_tokensintegerrequired

    Required by the Anthropic shape — the hard output cap.

  • messagesarrayrequired

    Anthropic-style turns: {role: user|assistant, content}.

  • systemstringoptional

    System prompt — a top-level field here, not a message role.

  • streambooleanoptional

    Streams Anthropic-native SSE events (message_start, content_block_delta, …).

  • temperaturenumberoptional

    0 to 1 in the Anthropic scale.

  • toolsarrayoptional

    Anthropic 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.

Full error-code table →

#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.