Endpoints
Messages
POST /v1/messages: the Anthropic-compatible endpoint for text generation.
Create a message. This endpoint is a drop-in Anthropic Messages API, so any Anthropic-compatible client works when pointed at the Spoof base URL.
https://api.spoofzone.com/v1/messagesRequest parameters
modelstringrequiredThe model ID to call, for example claude-sonnet-4-6. See Models.
max_tokensintegerrequiredThe maximum number of tokens to generate before stopping. Large values are capped by a server ceiling; when that happens the response carries an x-spoof-clamped-max-tokens header with your original value.
messagesarrayrequiredThe conversation so far, as an array of { role, content } objects. role is user or assistant; content is a string or an array of content blocks (text, images, tool results).
systemstring | arrayA system prompt: instructions and context applied to the whole conversation.
temperaturenumberdefault: 1.0Amount of randomness, between 0.0 and 1.0. Lower is more deterministic. See the repair note below for newer models.
top_pnumberNucleus sampling. Use either temperature or top_p, not both.
top_kintegerOnly sample from the top K options for each token.
stop_sequencesarrayCustom text sequences that will stop generation.
streambooleandefault: falseWhen true, tokens are streamed back as server-sent events. See Streaming.
toolsarrayTool definitions the model may call. See Tool use.
tool_choiceobjectControls whether and which tool the model must use (auto, any, or a specific tool).
thinkingobjectEnable extended thinking with a token budget. On newer models this is adapted automatically to effort. See Extended thinking.
metadataobjectAn object with a user_id and other opaque metadata about the request.
Any other field from the Anthropic Messages API is accepted and passed through.
Parameter repair
Newer models reject some legacy sampling controls. Spoof adjusts the request for you rather than failing it: temperature, top_p, and top_k are stripped where a model no longer accepts them, and a legacy fixed-budget thinking is rewritten to the model's effort control. Anything adjusted is listed in the x-spoof-repaired-params response header.
Example
Response
A successful call returns a message object:
The usage block is what you are billed on. Cache writes are billed at 1.25x the input rate (5-minute cache) or 2x (1-hour cache).
Response headers
Alongside the body, responses carry a few Spoof headers:
Errors
See Errors for status codes. Common cases: 401 (bad key), 402 (wallet underfunded for this call), 429 (rate limited).