Skip to content
Veil

Messages

POST /v1/messages in the Anthropic format.

POST https://veil.st/anthropic/v1/messages

The Anthropic messages format, for the Anthropic SDKs and tools built on them. Set the SDK base URL to https://veil.st/anthropic. The SDK sends the key in x-api-key, which is accepted.

Request

curl https://veil.st/anthropic/v1/messages \
  -H "x-api-key: ak_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash-1017-abliterated",
    "max_tokens": 200,
    "messages": [{"role": "user", "content": "Say hello in five words."}]
  }'
FieldNotes
modelRequired.
max_tokensRequired and must be a number. Without it the request gets a 400.
messagesRequired. A non-empty array in the Anthropic format.
system, tools, streamPassed to the model.
output_config.effortOptional. Only the thinking model uses it. See Reasoning.

thinking, metadata and user are removed before the request is forwarded. Reasoning is controlled by the model id and output_config.effort, not by thinking. The anthropic-version header is not required.

Not every model is here

Some models are served in the chat completions format only. Calling one here returns 400 with the message This model is available on /v1/chat/completions only. Use chat completions for that model.

Response

{
  "id": "msg_...",
  "type": "message",
  "role": "assistant",
  "model": "deepseek-v4.1-flash-1017-abliterated",
  "content": [{ "type": "text", "text": "Hello there, how are you?" }],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": { "input_tokens": 14, "output_tokens": 7 }
}

Billing counts input_tokens, including any cache read and cache creation tokens the model reports, plus output_tokens.

Errors

Errors on this endpoint use the Anthropic envelope, with our own type strings inside it:

{
  "type": "error",
  "error": {
    "type": "invalid_api_key",
    "message": "Missing or invalid API key."
  }
}

The type strings are the same ones the chat completions endpoint uses. They are listed under Errors.

Messages | Docs | Veil