Create Chat Completion
Create a model response for the given prompt.
Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position.
Proxy validated completion request to defined API. Needs an user bearer token in the authorization header.
In: header
Header Parameters
ID of the model to use.
The prompt(s) to generate completions for - can be string, array of strings, tokens, or token arrays.
Generate best_of completions and return the best one. Must be greater than n if both are set.
1Echo back the prompt in addition to the completion.
falsePenalize new tokens based on their existing frequency (-2.0 to 2.0).
0Modify likelihood of specified tokens appearing (token ID -> bias from -100 to 100).
Include log probabilities on the most likely tokens (max 5).
Maximum number of tokens to generate in the completion.
16How many completions to generate for each prompt.
1Penalize new tokens based on whether they appear in the text so far (-2.0 to 2.0).
0Seed for deterministic sampling (best effort, not guaranteed).
Up to 4 sequences where the API will stop generating.
Stream back partial progress as server-sent events.
falseOptions for streaming response (only used when stream=True).
Suffix after completion of inserted text.
Sampling temperature (0-2). Higher = more random, lower = more deterministic.
1Nucleus sampling - consider tokens with top_p probability mass (0-1).
1Unique identifier for end-user to help monitor and detect abuse.
Response Body
curl -X POST "https://loading/v1/completions" \
-H "OpenAI-Organization: 5eb7cf5a86d9755df3a6c593" \
-H "OpenAI-Project: 5eb7cf5a86d9755df3a6c593" \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.1:8b",
"prompt": "Hello World",
"stream": false
}'{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": {
"text_offset": [
0
],
"token_logprobs": [
0
],
"tokens": [
"string"
],
"top_logprobs": [
{
"property1": 0,
"property2": 0
}
]
},
"text": "string"
}
],
"created": 0,
"id": "string",
"model": "string",
"object": "text_completion",
"system_fingerprint": "string",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.