Overview
This endpoint provides text to text functionality using Anthropic native format.
Authentication
This endpoint requires authentication using an API key header.
Your API key for authentication
anthropic-version
string
default:"2023-06-01"
required
The version of the Anthropic API to use
Request Body
model
string
default:"claude-sonnet-4-20250514-thinking"
required
The model to use for the request
messages
array
default:"[{'role': 'user', 'content': 'Who are you?'}]"
required
Array of message objects for the conversation. Each message must have a role (user or assistant) and content.
max_tokens
integer
default:"1024"
required
The maximum number of tokens to generate before stopping
Amount of randomness injected into the response. Ranges from 0.0 to 1.0
Use nucleus sampling. Ranges from 0.0 to 1.0
Only sample from the top K options for each subsequent token
Whether to incrementally stream the response using server-sent events
Custom text sequences that will cause the model to stop generating
Request Example
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-sonnet-4-20250514-thinking",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Who are you?"
}
]
}'
Response
Successful response with Anthropic format{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "I'm Claude, an AI assistant created by Anthropic."
}
],
"model": "claude-sonnet-4-20250514-thinking",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 15
}
}
Error Responses
{
"error": {
"type": "authentication_error",
"message": "Invalid API key"
}
}