Claude Messages API
POSThttps://api.acedata.cloud/v1/messages
POSThttps://api.acedata.cloud/claude/messages
Claude Messages API, and the official input and output are completely consistent.
Request Headers
authorizationstring
Bearer token
Request Body
modelstringRequired parameter
Used to complete the model you prompted.
toolsarray
List of tool definitions that can be called by the model.
top_kinteger
Sample only from the top K candidate tokens with the highest probabilities each time.
top_pnumber
Use the nucleus sampling strategy.
streamboolean
Whether to return responses incrementally through Server-Sent Events (SSE).
Please select
systemstring
System prompt.
messagesarrayRequired parameter
Input message list.
metadataobject
user_idstring
max_tokensintegerRequired parameter
Stop generating the maximum number of tokens output before.
temperaturenumber
The degree of randomness in the injection response.
tool_choiceobject
The model uses the method of the provided tools.
stop_sequencesarray
Custom text sequence, when encountered, the model will stop generating.
Response
Claude AI
Allow Use General Balance
When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.
Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.
