Skip to main content
POST
/
v1
/
messages
Claude Chat
curl --request POST \
  --url https://api.ai.cc/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'anthropic-version: <anthropic-version>' \
  --data '
{
  "model": "claude-3-opus-20240229",
  "messages": {
    "role": "user",
    "content": "hi"
  }
}
'
{
  "id": "<string>",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "<string>",
      "text": "<string>"
    }
  ],
  "model": "<string>",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "cache_creation_input_tokens": 123,
    "cache_read_input_tokens": 123
  }
}
This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at Claude Docs.

Authorizations

Authorization
string
header
required

Authentication is done using Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Headers

anthropic-version
string
required

Anthropic API version

Example:

"2023-06-01"

x-api-key
string

Anthropic API Key (optional; Bearer Token can also be used)

Body

application/json
model
string
required
messages
object[]
required
max_tokens
integer
required
Required range: x >= 1
system
temperature
number
Required range: 0 <= x <= 1
top_p
number
top_k
integer
stream
boolean
stop_sequences
string[]
tools
object[]
tool_choice
object
thinking
object
metadata
object

Response

200 - application/json

Successfully created response

id
string
type
string
Example:

"message"

role
string
Example:

"assistant"

content
object[]
model
string
stop_reason
enum<string>
Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use
usage
object