메인 콘텐츠로 건너뛰기
POST
/
v1
/
chat
/
completions
채팅 완성 생성
curl --request POST \
  --url https://apiany.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-5.4",
  "messages": [
    {
      "role": "user",
      "content": "Write a concise product tagline for APIAny.AI."
    }
  ],
  "temperature": 0.7
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {}
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "input_tokens": 123,
    "output_tokens": 123,
    "cached_input_tokens": 123
  }
}

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

본문

application/json
model
string
필수
예시:

"gpt-5.4"

messages
object[]
필수
temperature
number

샘플링 온도입니다.

필수 범위: 0 <= x <= 2
top_p
number

뉴클리어스 샘플링 누적 확률입니다.

필수 범위: 0 <= x <= 1
max_tokens
integer

응답의 최대 토큰 수입니다.

필수 범위: x >= 1
stop

최대 4개의 정지 시퀀스입니다.

n
integer

생성할 후보 응답 수입니다.

필수 범위: x >= 1
frequency_penalty
number
필수 범위: -2 <= x <= 2
presence_penalty
number
필수 범위: -2 <= x <= 2
seed
integer

가능한 한 재현 가능한 샘플링 시드입니다.

response_format
object

JSON 객체 또는 JSON Schema 출력을 강제합니다. 예: { "type": "json_object" }.

tools
object[]

모델이 호출할 수 있는 도구/함수 선언입니다.

tool_choice

도구 선택: 'auto' | 'none' | 'required' | { type: 'function', function: { name } }.

logprobs
boolean
top_logprobs
integer
필수 범위: 0 <= x <= 20
logit_bias
object
user
string

오남용 모니터링을 위한 최종 사용자 식별자입니다.

stream
boolean

true이면 SSE로 증분 델타를 스트리밍하며(OpenAI chat.completion.chunk), 'data: [DONE]'로 종료됩니다.

응답

OpenAI 호환 채팅 완성 응답입니다.

id
string
필수
object
string
필수
예시:

"chat.completion"

created
integer
필수
model
string
필수
choices
object[]
필수
usage
object