Claude messages
Authorization
BearerAuth
AuthorizationBearer <token>
Bearer token authentication.
Format: Authorization: Bearer sk-xxxxxx
In: header
Header Parameters
anthropic-version*string
Anthropic API version
x-api-key?string
Anthropic API key (optional; a Bearer token also works)
Request Body
application/json
model*string
messages*
system?string|
max_tokens*integer
Range
1 <= valuetemperature?number
Range
0 <= value <= 1top_p?number
top_k?integer
stream?boolean
stop_sequences?array<string>
tools?
tool_choice?
thinking?
metadata?
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://pinerouter.ai/v1/messages" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5-2", "max_tokens": 200, "messages": [ { "role": "user", "content": "Explain DNS in one sentence." } ] }'{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": "string",
"text": "string"
}
],
"model": "string",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
}
}{
"error": {
"code": "",
"message": "Invalid token (request id: 20261102053704107200635868d9d6m7EOL5JK)",
"type": "api_error"
}
}{
"error": {
"code": "",
"message": "This token has no access to model gpt-5-2 (request id: 20261102053704107200635868d9d6m7EOL5JK)",
"type": "api_error"
}
}{
"error": {
"code": "",
"message": "You have reached the request limit: maximum 60 requests in 1 minutes (request id: 20261102053704107200635868d9d6m7EOL5JK)",
"type": "api_error"
}
}{
"type": "error",
"error": {
"type": "api_error",
"message": "bad response status code 500 (request id: 20261102053704107200635868d9d6m7EOL5JK)"
}
}