curl --request POST \
--url https://api.altrum.ai/anthropic/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "anthropic/claude-sonnet-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}
'import requests
url = "https://api.altrum.ai/anthropic/v1/messages"
payload = {
"model": "anthropic/claude-sonnet-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'anthropic/claude-sonnet-4-5',
max_tokens: 256,
messages: [{role: 'user', content: 'Say hello.'}]
})
};
fetch('https://api.altrum.ai/anthropic/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "msg_123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello."
}
],
"stop_reason": "end_turn"
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}Create a message
Sends a request in the Anthropic Messages format. Any supported provider can answer: the reply comes back in the Anthropic format.
curl --request POST \
--url https://api.altrum.ai/anthropic/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "anthropic/claude-sonnet-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}
'import requests
url = "https://api.altrum.ai/anthropic/v1/messages"
payload = {
"model": "anthropic/claude-sonnet-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'anthropic/claude-sonnet-4-5',
max_tokens: 256,
messages: [{role: 'user', content: 'Say hello.'}]
})
};
fetch('https://api.altrum.ai/anthropic/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "msg_123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello."
}
],
"stop_reason": "end_turn"
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}{
"type": "error",
"error": {
"type": "model_blocked",
"message": "Model 'claude-opus-4' is not allowed"
},
"request_id": "4f9c..."
}Authorizations
Your virtual key, sk-alt-.... What every OpenAI and Anthropic SDK sends.
Headers
Your own reference for the request. Altrum uses it instead of making one, and returns it.
Use a prompt saved in your AI Gateway prompts. Its messages go before yours.
The prompt version to use, such as 2. Without it, the latest version.
Keeps this request's cached answers apart from others, for example per customer.
Keeps the answer for less time than your setting: 30s, 5m, 1h or a number of seconds.
Asks for a closer match than your setting, from 0 to 1.
direct matches word for word only, semantic by meaning only.
direct, semantic true serves from the cache when it can, but does not store this answer.
true true keeps this request's prompt and reply out of the request log, even when your organization keeps content.
true true sends your own provider key in Authorization, x-api-key or x-goog-api-key, with your virtual key in x-alt-vk. Only when your organization allows it.
true Body
An Anthropic Messages request. Every other field the Anthropic API accepts is passed to the model.
The provider and the model, such as openai/gpt-4o-mini. A name without a provider is matched to one your organization can serve.
"openai/gpt-4o-mini"
Stream the answer as server-sent events.
Models to try in order when an attempt fails. Altrum's addition to the request body.
Response
The message.
The response is of type object.