Skip to main content
POST
Anthropic-compatible Messages

Authorizations

Authorization
string
header
required

Your Nugen API key, sent as a Bearer token

Headers

X-Session-ID
string | null

Body

application/json

A request in the Anthropic Messages shape.

model
string
required

Aligned model id, e.g. model_01kmqm4nrn9fw6r

messages
AnthropicMessage · object[]
required

The conversation so far

max_tokens
integer
required

Maximum tokens to generate

system
string | null

System prompt

temperature
number | null
default:1

Sampling temperature, between 0 and 2

Required range: 0 <= x <= 2
top_p
number | null

Nucleus sampling parameter

Required range: 0 <= x <= 1
top_k
integer | null

Sample from the top k tokens only

Required range: x >= 0
stop_sequences
string[] | null

Sequences that end generation

stream
boolean | null
default:false

Stream chat completion chunks as server-sent events. Defaults to false.

metadata
Metadata · object | null

Optional metadata, ignored by the model

Response

Successful Response

A reply in the Anthropic Messages shape.

id
string
required

Unique identifier of the message

type
string
required

Always "message".

Allowed value: "message"
role
string
required

Always "assistant".

Allowed value: "assistant"
content
AnthropicContentBlock · object[]
required

Generated content blocks

model
string
required

Model id the caller sent

usage
AnthropicUsage · object
required

Token counts for the call

stop_reason
string | null

Why generation ended

stop_sequence
string | null

The stop sequence that ended generation, if any