plaingateway
API reference

Messages

Create an Anthropic-shaped message.

POST /messages accepts model as a string, messages as an array, and max_tokens as an integer. It also supports images, tools, thinking, caching, and streams as recorded.

Request

http
POST https://plaingateway.com/api/v1/messages
Authorization: Bearer sk-pg-v1-...
Content-Type: application/json

{
  "model": "anthropic/claude-haiku-5.5",
  "max_tokens": 32,
  "messages": [
    {
      "role": "user",
      "content": "Say hello in five words."
    }
  ]
}

Response

http
HTTP/1.1 200
{
  "id": "msg_SCRUBBED-1",
  "type": "message",
  "role": "assistant",
  "container": null,
  "content": [
    {
      "type": "text",
      "text": "Hello there, friend, how are you?",
      "citations": []
    }
  ],
  "model": "anthropic/claude-haiku-5.5",
  "stop_reason": "end_turn",
  "stop_details": null,
  "stop_sequence": null,
  "usage": {
    "input_tokens": 16,
    "output_tokens": 14,
    "output_tokens_details": {
      "thinking_tokens": 0
    },
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "cache_creation": {
      "ephemeral_5m_input_tokens": 0,
      "ephemeral_1h_input_tokens": 0
    },
    "inference_geo": "global",
    "server_tool_use": null,
    "service_tier": "standard",
    "speed": "standard",
    "cost": 8.6e-06,
    "is_byok": false,
    "cost_details": {
      "upstream_inference_cost": 8.6e-06,
      "upstream_inference_prompt_cost": 1.6e-06,
      "upstream_inference_completions_cost": 7e-06
    }
  },
  "context_management": null,
  "provider": "Claude Platform on AWS"
}