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"
}
}
'import requests
url = "https://api.ai.cc/v1/messages"
payload = {
"model": "claude-3-opus-20240229",
"messages": {
"role": "user",
"content": "hi"
}
}
headers = {
"anthropic-version": "<anthropic-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'anthropic-version': '<anthropic-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({model: 'claude-3-opus-20240229', messages: {role: 'user', content: 'hi'}})
};
fetch('https://api.ai.cc/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ai.cc/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'claude-3-opus-20240229',
'messages' => [
'role' => 'user',
'content' => 'hi'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"anthropic-version: <anthropic-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ai.cc/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-3-opus-20240229\",\n \"messages\": {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ai.cc/v1/messages")
.header("anthropic-version", "<anthropic-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-3-opus-20240229\",\n \"messages\": {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ai.cc/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["anthropic-version"] = '<anthropic-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"claude-3-opus-20240229\",\n \"messages\": {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "message",
"role": "assistant",
"content": [
{
"type": "<string>",
"text": "<string>"
}
],
"model": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123
}
}Chat
Native Claude Format
Requests must be in the Anthropic Claude Messages API format.
The request header must include anthropic-version.
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"
}
}
'import requests
url = "https://api.ai.cc/v1/messages"
payload = {
"model": "claude-3-opus-20240229",
"messages": {
"role": "user",
"content": "hi"
}
}
headers = {
"anthropic-version": "<anthropic-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'anthropic-version': '<anthropic-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({model: 'claude-3-opus-20240229', messages: {role: 'user', content: 'hi'}})
};
fetch('https://api.ai.cc/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ai.cc/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'claude-3-opus-20240229',
'messages' => [
'role' => 'user',
'content' => 'hi'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"anthropic-version: <anthropic-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ai.cc/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-3-opus-20240229\",\n \"messages\": {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ai.cc/v1/messages")
.header("anthropic-version", "<anthropic-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-3-opus-20240229\",\n \"messages\": {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ai.cc/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["anthropic-version"] = '<anthropic-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"claude-3-opus-20240229\",\n \"messages\": {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "message",
"role": "assistant",
"content": [
{
"type": "<string>",
"text": "<string>"
}
],
"model": "<string>",
"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
Authentication is done using Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Headers
Anthropic API version
Example:
"2023-06-01"
Anthropic API Key (optional; Bearer Token can also be used)
Body
application/json
Show child attributes
Show child attributes
Required range:
x >= 1Required range:
0 <= x <= 1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

