openai

Create a chat completion

Creates a chat completion for the provided messages and parameters.

post/v1/chat/completions

Request

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

Request body

modelstring required

ID of the model to use for the chat completion.

streamboolean nullable

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

temperaturenumber nullable

Sampling temperature between 0 and 2. Higher values make output more random.

top_pnumber nullable

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

ninteger nullable

How many chat completion choices to generate.

max_tokensinteger nullable

Maximum number of tokens to generate. Deprecated in favor of max_completion_tokens.

max_completion_tokensinteger nullable

Upper bound for tokens that can be generated, including visible output and reasoning tokens.

frequency_penaltynumber nullable

Number between -2.0 and 2.0. Positive values penalize tokens based on existing frequency.

presence_penaltynumber nullable

Number between -2.0 and 2.0. Positive values penalize tokens based on whether they appear in the text so far.

logprobsboolean nullable

Whether to return log probabilities of the output tokens.

top_logprobsinteger nullable

Number of most likely tokens to return at each position (0-20). Requires logprobs=true.

logit_biasobject nullable

Map of token IDs to bias values (-100 to 100) to modify likelihood of specified tokens.

seedinteger nullable

If specified, the system will attempt deterministic sampling. Determinism is not guaranteed.

parallel_tool_callsboolean

Whether to enable parallel function calling during tool use.

reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'

Constrains reasoning effort for reasoning models. The accepted values are per-model — read reasoning_efforts from GET /v1/models. A value outside that model's set is rejected.

top_kinteger nullable

Number of highest probability tokens to keep for top-k sampling. -1 to disable.

min_pnumber nullable

Minimum probability threshold relative to the top token. Tokens below this are filtered out. 0.0 to disable.

repetition_penaltynumber nullable

Penalizes new tokens based on whether they appear in the generated text so far. Values > 1.0 penalize repetitions.

min_tokensinteger

Minimum number of tokens to generate before allowing a stop condition.

echoboolean

If true, the prompt is prepended to the generated output.

userstring nullable

A unique identifier representing your end-user.

Response

OK

idstring required
object'chat.completion' required
createdinteger required
modelstring required
system_fingerprintstring

Changes

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