Hoppa till huvudinnehåll
POST
/
v1
/
messages
Claude Messages
curl --request POST \
  --url https://api.acedata.cloud/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "claude-sonnet-4-6",
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "max_tokens": 1024,
  "metadata": {
    "user_id": "<string>"
  },
  "stop_sequences": [
    "<string>"
  ],
  "stream": false,
  "system": "<string>",
  "temperature": 1,
  "tool_choice": {},
  "tools": [
    {}
  ],
  "top_k": 123,
  "top_p": 123
}
'
{
  "id": "<string>",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "<string>",
      "id": "<string>",
      "name": "<string>",
      "input": {}
    }
  ],
  "model": "<string>",
  "stop_reason": "end_turn",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Auktoriseringar

Authorization
string
header
obligatorisk

Kropp

application/json
model
string
obligatorisk

The model that will complete your prompt.

Exempel:

"claude-sonnet-4-6"

messages
object[]
obligatorisk

Input messages.

max_tokens
integer
obligatorisk

The maximum number of tokens to generate before stopping.

Exempel:

1024

metadata
object
stop_sequences
string[]

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

stream
boolean
standard:false

Whether to incrementally stream the response using server-sent events.

system
string

System prompt.

temperature
number

Amount of randomness injected into the response.

Obligatoriskt intervall: 0 <= x <= 1
Exempel:

1

tool_choice
object

How the model should use the provided tools.

tools
object[]

Definitions of tools that the model may use.

top_k
integer

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

top_p
number

Use nucleus sampling.

Svar

OK

id
string
obligatorisk

Unique object identifier.

type
enum<string>
obligatorisk
Tillgängliga alternativ:
message
role
enum<string>
obligatorisk
Tillgängliga alternativ:
assistant
content
object[]
obligatorisk
model
string
obligatorisk

The model that handled the request.

stop_reason
enum<string> | null
obligatorisk
Tillgängliga alternativ:
end_turn,
max_tokens,
stop_sequence,
tool_use
stop_sequence
string | null
obligatorisk
usage
object
obligatorisk