Skip to main content
POST
/
anthropic
/
v1
/
complete
Create completion (Anthropic legacy format)
curl --request POST \
  --url http://localhost:8080/anthropic/v1/complete \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "max_tokens_to_sample": 123,
  "stream": true,
  "temperature": 0.5,
  "top_p": 123,
  "top_k": 123,
  "stop_sequences": [
    "<string>"
  ],
  "fallbacks": [
    "<string>"
  ]
}
'
{
  "type": "completion",
  "id": "<string>",
  "completion": "<string>",
  "stop_reason": "stop_sequence",
  "model": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Body

application/json
model
string
required

Model identifier

prompt
string
required

The prompt to complete

max_tokens_to_sample
integer
required

Maximum tokens to generate

stream
boolean
temperature
number
Required range: 0 <= x <= 1
top_p
number
top_k
integer
stop_sequences
string[]
fallbacks
string[]

Response

Successful response

type
string
default:completion
id
string
completion
string
stop_reason
enum<string>
Available options:
stop_sequence,
max_tokens,
model
string
usage
object