Messages

Endpoints

Messages ​

POST https://relumen.ai/v1/messages

Send a conversation to a supported Claude model in Anthropic format. Use the model and features available to your key's group.

Anthropic key required · yellow

Use an Anthropic-format key. A key assigned to an incompatible group can return model_not_found, even when the model name is correct.

Headers ​

HeaderRequiredValue
x-api-keyYesYour Relumen key
anthropic-versionYes2023-06-01
content-typeYesapplication/json

Body ​

modelstringrequired

Exact model call name from Model Plaza.

messagesarrayrequired

Conversation turns with role and content.

max_tokensintegerrequired

Maximum number of tokens to generate.

systemstringoptional

Instructions that guide the conversation.

streambooleanoptional

Set to true for a Server-Sent Events stream when supported.

For a basic text turn, use "role": "user" and a string for content. Feature support and token limits depend on the selected model and route.

Example request ​

Replace both placeholders before running this command.

bash
curl https://relumen.ai/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Example response ​

Illustrative non-streaming response. Identifiers, text, and usage vary by request.

json
{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "YOUR_MODEL_ID",
  "content": [
    {"type": "text", "text": "Hello! How can I help you?"}
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 18,
    "output_tokens": 12
  }
}

Usage & troubleshooting ​

Review Usage Records in the console for tokens and cost. If the call fails, confirm the exact model name, Anthropic key format, selected group, and remaining account balance. See Errors & troubleshooting.

Need help? Visit the Help Center →Open console ↗