DocsAPI reference
Messages
The Anthropic Messages shape, for Anthropic SDKs and Claude Code. Errors come back in Anthropic's shape too, so those clients behave normally.
POST/v1/messages
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "https://velaron.ai/v1", apiKey: "sk_••••••••" });
const reply = await client.messages.create({
model: "anthropic/claude-sonnet-4.5",
max_tokens: 1024,
messages: [{ role: "user", content: "hi" }],
});
console.log(reply.content[0].text);Request#
- model
A chat model id. Anthropic models look like
anthropic/claude-sonnet-4.5, but any chat model on the server works through this endpoint.- max_tokens
Required by the Anthropic API and by Velaron.AI. Must be a positive integer; it is lowered when your balance cannot cover it.
- messages
A non-empty array of Anthropic-style messages.
- system
Counted toward the input estimate, then forwarded.
- anthropic-version
Forwarded to the provider. Defaults to
2023-06-01when your client sends none.
Billing details#
Cache reads and cache writes reported by the model are billed at its cache prices. Streams are read from message_start, message_delta and content_block_delta events and settled when the stream ends. A streamed Messages call carries no in-band credit report.
Errors#
{
"type": "error",
"error": {
"type": "billing_error",
"message": "You are out of credits. Buy more on your Velaron.AI dashboard.",
"code": "insufficient_credits"
}
}| Status | Anthropic type | Velaron.AI code |
|---|---|---|
| 400 | invalid_request_error | invalid_body · model_not_supported |
| 401 | authentication_error | invalid_api_key |
| 402 | billing_error | insufficient_credits |
| 404 | not_found_error | model_not_found |
| 429 | rate_limit_error | rate_limit_exceeded |
| 5xx | api_error | provider_unreachable · provider_not_configured |
