For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Completions

Create Completions by calling an available model in a format that is compatible with the OpenAI API

post
Authorizations
AuthorizationstringRequired

Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.

Body
modelstringRequired

ID of the model to use

promptstringRequired

The prompt to generate completions from

temperaturenumberOptional

The sampling temperature to be used

top_pnumberOptional

An alternative to sampling with temperature

nintegerOptional

The number of chat completion choices to generate for each input message

streambooleanOptional

If set to true, it sends partial message deltas

stopone ofOptional

Up to 4 sequences where the API will stop generating further tokens. Either a single sequence or an array of them.

stringOptional
or
string[] · max: 4Optional
max_tokensintegerOptional

The maximum number of tokens to generate in the chat completion

presence_penaltynumberOptional

It is used to penalize new tokens based on their existence in the text so far

frequency_penaltynumberOptional

It is used to penalize new tokens based on their frequency in the text so far

logit_biasobjectOptional

Used to modify the probability of specific tokens appearing in the completion

userstringOptional

A unique identifier representing your end-user

Responses
200

Successful operation

application/json
post/v1/completions
POST /v1/completions HTTP/1.1
Host: openai.inference.de-txl.ionos.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 236

{
  "model": "meta-llama/Llama-3.3-70B-Instruct",
  "prompt": "Say this is a test",
  "temperature": 0.01,
  "top_p": 0.9,
  "n": 1,
  "stream": false,
  "stop": [
    "\n"
  ],
  "max_tokens": 1000,
  "presence_penalty": 0,
  "frequency_penalty": 0,
  "logit_bias": {},
  "user": "user-123"
}
{
  "id": "text",
  "choices": [
    {
      "finish_reason": "text",
      "index": 1,
      "text": "text"
    }
  ],
  "created": 1,
  "object": "text",
  "model": "text",
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1
  }
}

Last updated

Was this helpful?