API Reference
Log In
API Reference

Completions

Use this endpoint with models tailored to generate a completion from a single prompt.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
enum
required

The model used to generate a completion.

Konko currently offers open source LLMs hosted by Konko and recommended LLMs provided by OpenAI.

See Available Models for details on which models work best for your use case.

string | null
required
Defaults to Please summarize the Harry Potter series for me.

The prompt the model uses to generate a completion.

See our prompting guidelines for more information.

integer | null
≥ 0
Defaults to 16

The chat completion's token limit, combined with input tokens, is bound by the model's context length. Different models have varying limits, with a common maximum being 2048 tokens, unless otherwise specified.

boolean | null
Defaults to false

When stream is set to True, the API sends partial message updates via HTTP streaming as they're available, useful for real-time data or large messages benefiting from incremental delivery.

Defaults to <|endoftext|>

Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.

number | null
0 to 2
Defaults to 1

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this or top_p but not both.

number | null
0 to 1
Defaults to 1

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

number | null
-2 to 2
Defaults to 0

Currently, only OpenAI provided models support frequency_penalty. Use repetition_penalty with all other models.

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the generated text so far, decreasing the model's likelihood to repeat the same line verbatim.

number | null
-2 to 2
Defaults to 0

Currently, only OpenAI provided models support presence_penalty. Use repetition_penalty with all other models.

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

number | null
-2 to 2
Defaults to 0

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the input prompt and the generated text so far, decreasing the model's likelihood to repeat the same line verbatim.

logit_bias
object | null

Currently, only OpenAI provided models support logit_bias.

Adjusts the chances of specific tokens in the completion.

Uses a JSON object mapping tokens (by their ID) to a bias value (-100 to 100).

This bias tweaks the model's output before sampling.

Values between -1 and 1 subtly change token likelihood.

Values near -100 or 100 typically ban or exclusively pick that token.

integer | null
0 to 5
Defaults to null

Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.

The maximum value for logprobs is 5.

integer | null
1 to 128
Defaults to 1

Currently, only OpenAI provided models support n.

How many completions to generate for each prompt.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.

integer | null
0 to 20
Defaults to 1

Currently, only OpenAI provided models support best_of.

Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.

When used with n, best_of controls the number of candidate completions and n specifies how many to return – best_of must be greater than n.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.

boolean | null
Defaults to false

Echo back the prompt in addition to the completion

integer | null
-9223372036854776000 to 9223372036854776000

Currently, only OpenAI provided models support seed.

If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.

string | null
Defaults to null

The suffix that comes after a completion of inserted text.

Headers
string

OpenAI API key. Required for the Konko API to access the OpenAI API.

Response

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json