LLM Gateway

Anthropic Messages

Create a message using Anthropic's API format

POST
/v1/messages

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token authentication using API keys

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://api.llmgateway.io/v1/messages" \  -H "Content-Type: application/json" \  -d '{    "model": "claude-3-5-sonnet-20241022",    "messages": [      {        "role": "user",        "content": "string"      }    ],    "max_tokens": 1024  }'
{
  "id": "string",
  "type": "message",
  "role": "assistant",
  "model": "string",
  "content": [
    {
      "type": "text",
      "text": "string",
      "id": "string",
      "name": "string",
      "input": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": "string",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  }
}

How is this guide?

Last updated on