메인 콘텐츠로 건너뛰기
POST
/
v1
/
chat
/
completions
OpenAI chat completions
curl --request POST \
  --url https://maas.apigo.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "system",
      "content": "<string>"
    }
  ],
  "temperature": 1,
  "stream": true
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "system",
        "content": "<string>"
      },
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt

Use this file to discover all available pages before exploring further.

채팅 대화에 대한 모델 응답을 만듭니다. 이 엔드포인트는 기존 OpenAI SDK, 채팅 클라이언트 또는 레거시 채팅 완료 워크플로와의 호환성이 필요할 때 여전히 가장 안전한 기본값입니다. 지원되는 필드는 특히 추론, 도구 사용 및 다중 모드 입력의 경우 모델에 따라 다릅니다.

통합 지침

  • Authorization: Bearer {API_KEY}로 인증
  • 이를 기존 OpenAI 스타일 채팅 통합의 기본 진입점으로 사용합니다.
  • 구조화된 출력, 다중 모드 입력 및 도구에 대한 보다 통합된 인터페이스를 원한다면 /v1/responses를 선호하세요.
  • 스트리밍 클라이언트는 하나의 최종 JSON 응답을 기다리는 대신 SSE 청크를 점진적으로 처리해야 합니다.

요청 하이라이트

  • messages가 필요하며 대화 기록을 전달합니다.
  • model가 필요하며 대상 모델을 선택합니다.
  • temperaturetop_p는 모두 샘플링에 영향을 미치지만 대부분의 통합에서는 둘 중 하나만 조정해야 합니다.
  • 토큰 수준의 확률이 필요한 경우 logprobstop_logprobs를 결합하세요.
  • 캐싱 및 안전 속성을 위해서는 prompt_cache_keysafety_identifier를 선호합니다.

응답 하이라이트

  • 일반 텍스트는 일반적으로 choices[0].message.content에서 읽습니다.
  • message.tool_calls에서 도구 호출을 읽을 수 있습니다.
  • 스트리밍 응답은 SSE 청크로 도착하며 점진적으로 병합되어야 합니다.
  • 보다 자세한 토큰 분석을 포함하여 사용량 계산은 usage를 통해 노출됩니다.

인증

Authorization
string
header
필수

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

본문

application/json
model
string
필수
예시:

"gpt-4o"

messages
object[]
필수
temperature
number<double>

采样温度。类型:double。取值范围:0-2。

필수 범위: 0 <= x <= 2
stream
boolean

응답

Successful chat completion response

id
string
object
string
예시:

"chat.completion"

choices
object[]
usage
object