Claude-3-7-Sonnet-Thinking-All - Text To Text
Claude-3-7-Sonnet-Thinking-All — Text To Text. GPTProto API reference.
POST
/
v1
/
messages
claude-3-7-sonnet-thinking-all (text to text)
curl --request POST \
--url https://api.example.com/v1/messagesimport requests
url = "https://api.example.com/v1/messages"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/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.example.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/messages"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyClaude’s official format for the text to text API.
curl -X POST "https://gptproto.com/v1/messages" \
-H "Authorization: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-7-sonnet-thinking-all",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Who are you?"
}
]
}'
import anthropic
client = anthropic.Anthropic(
api_key="YOUR_API_KEY",
base_url="https://gptproto.com"
)
message = client.messages.create(
model="claude-3-7-sonnet-thinking-all",
max_tokens=1024,
messages=[
{"role": "user", "content": "Who are you?"}
]
)
print(message.content)
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://gptproto.com'
});
const message = await client.messages.create({
model: 'claude-3-7-sonnet-thinking-all',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'Who are you?' }
]
});
console.log(message.content);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://gptproto.com/v1/messages"
payload := []byte(`{
"model": "claude-3-7-sonnet-thinking-all",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Who are you?"
}
]
}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
req.Header.Set("Authorization", "YOUR_API_KEY")
req.Header.Set("anthropic-version", "2023-06-01")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"error": {
"type": "authentication_error",
"message": "Invalid API key"
}
}
{
"error": {
"type": "invalid_request_error",
"message": "messages: field required"
}
}
{
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded"
}
}
{
"error": {
"type": "api_error",
"message": "Internal server error"
}
}
{
"error": {
"type": "overloaded_error",
"message": "Service is temporarily overloaded"
}
}
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | ✅ Yes | claude-3-7-sonnet-thinking-all | The model to use for the request |
messages | array | ✅ Yes | [{'role': 'user', 'content': 'Who are you?'}] | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. |
max_tokens | integer | ✅ Yes | 1024 | The maximum number of tokens to generate before stopping |
temperature | number | ❌ No | 1.0 | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 |
top_p | number | ❌ No | 1.0 | Use nucleus sampling. Ranges from 0.0 to 1.0 |
top_k | integer | ❌ No | null | Only sample from the top K options for each subsequent token |
stream | boolean | ❌ No | false | Whether to incrementally stream the response using server-sent events |
stop_sequences | array | ❌ No | - | Custom text sequences that will cause the model to stop generating |
Messages Array Structure
Each message object in themessages array should have the following structure:
| Field | Type | Required | Description |
|---|---|---|---|
role | string | ✅ Yes | The role of the message. Can be: user, assistant, or system |
content | array/string | ✅ Yes | The content of the message |
Content Array Structure (when content is an array)
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
type | string | ✅ Yes | text | The type of content |
text | string | ✅ Yes | "The positive prompt for the generation." | The text content when type is text |
⌘I

