Skip to main content
POST
Python

Authorizations

Authorization
string
header
required

API key provided as a Bearer token: Authorization: Bearer <api_key>. Get an API key at https://platform.inceptionlabs.ai.

Body

application/json
prompt
string
required

The prompt to complete.

model
string
required

The model to use for the FIM completion.

suffix
string

The suffix to complete.

max_tokens
integer
default:512

Maximum number of tokens to generate.

Required range: 1 <= x <= 8192
top_p
number
default:1

Float that controls the cumulative probability of the top tokens to consider.

Required range: 0 <= x <= 1
top_k
integer
default:-1

Limits sampling to the k most likely tokens. Must be -1 (disables the cutoff and considers all tokens) or an integer from 1 to 1000; other values such as 0 are rejected.

Required range: -1 <= x <= 1000
frequency_penalty
number
default:0

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

Required range: -2 <= x <= 2
presence_penalty
number
default:1.5

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

Required range: -2 <= x <= 2
repetition_penalty
number
default:1

Penalizes tokens that have already appeared in the generated text. Must be greater than 0. Values greater than 1.0 discourage repetition; 1.0 applies no penalty.

Required range: x >= 0
stop
string[]

A list of sequences where the API will stop generating further tokens. The returned text will not contain the stop sequences. Defaults to common code-block boundaries.

stream
boolean
default:false

Whether to stream the response.

stream_options
StreamOptions · object

Options that control streaming behavior.

Response

Successful response. Returns a JSON object when stream=false, or a server-sent events stream of TextCompletionChunk objects (terminated by data: [DONE]) when stream=true.

id
string
required
object
string
default:text_completion
required
Allowed value: "text_completion"
created
integer
required
model
string
required
choices
TextCompletionChoice · object[]
required
usage
FIMUsage · object
required

Usage for FIM completions.

warning
string | null