Anthropic Messages
POST /v1/messages — compatible with Anthropic's Messages API. This is a real adapter layer, not renamed OpenAI fields: system prompts, content blocks, and stop reasons follow Anthropic's shape.
Using the Anthropic SDK
python
from anthropic import Anthropic
client = Anthropic(
base_url="https://api-gw.aimasteryedu.in",
api_key="YOUR_API_KEY",
)
msg = client.messages.create(
model="varunsh/atlas-mini",
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)Request
json
{
"model": "varunsh/atlas-mini",
"max_tokens": 256,
"system": "You are concise.",
"messages": [
{ "role": "user", "content": "What is an API gateway?" }
]
}Response
json
{
"id": "msg_...",
"type": "message",
"role": "assistant",
"model": "varunsh/atlas-mini",
"content": [{ "type": "text", "text": "..." }],
"stop_reason": "end_turn",
"usage": { "input_tokens": 18, "output_tokens": 122 }
}Streaming
With "stream": true, events follow Anthropic's sequence: message_start, content_block_delta, message_delta, message_stop.