Skip to main content
POST
/
v1
/
messages
Create a Message
curl --request POST \
  --url https://api.mulerun.com/v1/messages \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "max_tokens": 1024,
  "messages": [
    {
      "content": "Hello, world",
      "role": "user"
    }
  ],
  "model": "claude-sonnet-4-20250514"
}'
{
  "content": [
    {
      "text": "Hi! My name is Claude.",
      "type": "text"
    }
  ],
  "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
  "model": "claude-sonnet-4-20250514",
  "role": "assistant",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "input_tokens": 2095,
    "output_tokens": 503
  }
}
This API is compatible with Anthropic’s format.For more details, please refer to Anthropic’s official documentation.

Authorizations

X-API-Key
string
header
required

Headers

anthropic-version
string

Body

application/json
model
string
required
Examples:
messages
Messages · object[]
required
max_tokens
integer
required
Required range: x >= 1
Examples:
metadata
object
service_tier
enum<string>
Available options:
auto,
standard_only
stop_sequences
string[]
stream
boolean
system
Examples:
temperature
number
Required range: 0 <= x <= 1
Examples:
thinking
object
  • ThinkingConfigEnabled
  • ThinkingConfigDisabled
tool_choice
object
  • ToolChoiceAuto
  • ToolChoiceAny
  • ToolChoiceTool
  • ToolChoiceNone
tools
Tools · array
  • Tool
  • BashTool_20250124
  • TextEditor_20250124
  • TextEditor_20250429
  • TextEditor_20250728
  • WebSearchTool_20250305
Examples:
top_k
integer
Required range: x >= 0
Examples:
top_p
number
Required range: 0 <= x <= 1
Examples:

Response

200 - application/json
id
string
required
Examples:
type
enum<string>
default:message
required
Available options:
TitleConst
Typemessage
role
enum<string>
default:assistant
required
Available options:
TitleConst
Roleassistant
content
Content · array
required
  • ResponseTextBlock
  • ResponseThinkingBlock
  • ResponseRedactedThinkingBlock
  • ResponseToolUseBlock
  • ResponseServerToolUseBlock
  • ResponseWebSearchToolResultBlock
Examples:
model
string
required
Examples:
stop_reason
enum<string> | null
required
Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use,
pause_turn,
refusal
stop_sequence
string | null
required
usage
object
required