Skip to main content
POST
Create text completion
이것은 레거시 엔드포인트입니다. 대부분의 사용 사례에서는 채팅 완성을 사용하세요.

요청 본문

string
필수
사용할 모델 ID입니다.
string | string[]
필수
완성을 생성할 프롬프트입니다.
integer
기본값:16
생성할 최대 토큰 수입니다.
number
기본값:1
0에서 2 사이의 샘플링 온도입니다.
number
기본값:1
핵 샘플링 파라미터입니다.
string | string[]
정지 시퀀스입니다.
string
완성 후에 추가할 텍스트입니다.

응답

예제

인증

Authorization
string
header
필수

API key authentication. Pass your OpenModex API key as a Bearer token in the Authorization header: Authorization: Bearer omx_sk_...

본문

application/json

Request body for creating a text completion (legacy).

model
string
필수

ID of the model to use.

prompt
필수

The prompt(s) to generate completions for.

max_tokens
integer

The maximum number of tokens to generate.

temperature
number

Sampling temperature between 0 and 2.

top_p
number

Nucleus sampling parameter.

n
integer

How many completions to generate for each prompt.

stream
boolean
기본값:false

Whether to stream back partial progress via SSE.

stop

Up to 4 sequences where the API will stop generating further tokens.

frequency_penalty
number

Penalizes new tokens based on their existing frequency in the text.

presence_penalty
number

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

logit_bias
object

Modify the likelihood of specified tokens appearing in the completion.

suffix
string

The suffix that comes after a completion of inserted text.

user
string

A unique identifier representing your end-user.

routing
object

Configuration for intelligent request routing.

응답

Text completion response.

Response from a text completion request.

id
string

A unique identifier for the completion.

object
enum<string>

The object type, always 'text_completion'.

사용 가능한 옵션:
text_completion
created
integer

Unix timestamp (in seconds) of when the completion was created.

model
string

The model used for the completion.

choices
object[]

A list of completion choices.

usage
object

Token usage statistics for a completion request.

openmodex
object

OpenModex-specific metadata included in completion responses.