Create Completions
Create Completions by calling an available model in a format that is compatible with the OpenAI API
Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.
ID of the model to use
The prompt to generate completions from
The sampling temperature to be used
An alternative to sampling with temperature
The number of chat completion choices to generate for each input message
If set to true, it sends partial message deltas
Up to 4 sequences where the API will stop generating further tokens. Either a single sequence or an array of them.
The maximum number of tokens to generate in the chat completion
It is used to penalize new tokens based on their existence in the text so far
It is used to penalize new tokens based on their frequency in the text so far
Used to modify the probability of specific tokens appearing in the completion
A unique identifier representing your end-user
Successful operation
The request was rejected before it reached a model. The message names the field at fault.
The request body, an inline base64 media payload, or the number of content parts in a single message, query, or document exceeds a documented limit, or a requested image's width or height is above the maximum supported size. Pass large media as a remote http(s) URL instead of inline base64 - a remote URL is fetched directly by the model and does not count against the request body size.
Rate limit exceeded. This response carries no Retry-After header, so back off exponentially and watch X-RateLimit-Remaining-Requests on successful responses to slow down before reaching the limit. Limits are contract-specific.
The request failed on our side. It may or may not have been carried out, so a retry is safe for idempotent calls.
The platform is temporarily overloaded and is shedding load to stay stable. Retry after the number of seconds indicated by the Retry-After header. This is unrelated to your contract's rate limits.
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?