openai

Create a completion

Creates a completion for the provided prompt and parameters. This is a legacy endpoint — use /v1/chat/completions for new integrations.

post/v1/completions

Request

  • Base URL: https://api.aiand.com
  • URL: https://api.aiand.com/v1/completions
  • Auth: HTTP bearer

Request body

modelstring required

ID of the model to use for the completion.

streamboolean nullable

If true, partial completions will be sent as server-sent events.

temperaturenumber nullable

Sampling temperature between 0 and 2.

top_pnumber nullable

Nucleus sampling: consider tokens with top_p probability mass. Greater than 0 and at most 1.

ninteger nullable

How many completions to generate for each prompt.

max_tokensinteger nullable

Maximum number of tokens to generate.

frequency_penaltynumber nullable

Penalizes tokens based on existing frequency in the text so far.

presence_penaltynumber nullable

Penalizes tokens based on whether they appear in the text so far.

logprobsinteger nullable

Include the log probabilities on the most likely output tokens (0-5).

echoboolean nullable

Echo back the prompt in addition to the completion.

best_ofinteger nullable

Generates best_of completions server-side and returns the best one. Cannot be used with stream.

suffixstring nullable

The suffix that comes after the completion.

seedinteger nullable

If specified, the system will attempt deterministic sampling.

userstring nullable

A unique identifier representing your end-user.

Response

OK

idstring required
object'text_completion' required
createdinteger required
modelstring required
system_fingerprintstring

Changes

No recorded changes to this operation across all 1 revision of this API.