Light Logo
Anthropic

Create a message.

Anthropic compatible messages endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled. This endpoint is experimental and may change or be removed.

POST
/messages
AuthorizationBearer <token>

In: header

modelModel

The model to use for this compatible endpoint. Models must be in the following format: model_owner/model_name or model_owner/model_name:version_number.

max_tokensMax Tokens

The maximum number of tokens to generate before stopping.

messagesMessages

Input messages.

output_config?OutputConfigParam | null

Configuration options for the model's output

stop_sequences?Stop Sequences

Custom text sequences that will cause the model to stop generating.

system?System

A system prompt is a way of providing context and instructions to the model.

temperature?Temperature

Amount of randomness injected into the response.

thinking?Thinking

Configuration for enabling the model's extended thinking.

tool_choice?Tool Choice

How the model should use the provided tools.

tools?Tools

Definitions of tools that the model may use.

top_k?Top K

Only sample from the top K options for each subsequent token.

top_p?Top P

Use nucleus sampling.

Response Body

curl -X POST "https://api.wrift.ai/v1/messages" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "max_tokens": 0,    "messages": [      {        "content": "string",        "role": "user"      }    ]  }'
{
  "id": "string",
  "content": [
    {
      "text": "string",
      "type": "text",
      "citations": [
        {
          "type": "web_search_result_location",
          "cited_text": "string",
          "encrypted_index": "string",
          "title": "string",
          "url": "string"
        }
      ]
    }
  ],
  "model": "string",
  "role": "assistant",
  "stop_reason": "end_turn",
  "stop_sequence": "string",
  "type": "message",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}