Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
공개 GET /api/models catalog 엔드포인트를 호출해 사용 가능한 모델을 나열할 수 있습니다. 반환된 model ID를 API 요청에 사용한 다음, model directory에서 기능과 가격 세부 정보를 확인하세요.
모델 catalog 호출
다음 요청은 사용 가능한 모델을 나열합니다:
curl https://api.cometapi.com/api/models
응답에는 모델 레코드가 포함됩니다:
{
"success": true,
"page": 0,
"page_size": 0,
"total": 301,
"data": [
{
"id": "gpt-image-2",
"provider": "OpenAI",
"model_type": "image",
"features": [
"text-to-image"
],
"pricing": {
"currency": "USD / M Tokens",
"input": 4,
"output": 24,
"per_request": null,
"per_second": null
},
"api_doc_url": "https://apidoc.cometapi.com/api/image/openai/images"
}
]
}
Python 모델 목록
다음 Python 예제는 catalog에서 model ID를 출력합니다:
import requests
response = requests.get("https://api.cometapi.com/api/models", timeout=30)
response.raise_for_status()
models = response.json()["data"]
for model in models:
print(model["id"])
출력은 model ID 목록입니다:
your-model-id
another-model-id
model ID 사용
다음 예제는 catalog의 model ID 하나를 사용해 요청을 보냅니다:
curl https://api.cometapi.com/v1/chat/completions \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}'
응답은 선택한 model ID를 사용합니다:
{
"model": "your-model-id",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello."
}
}
]
}
일반적인 오류
| 오류 | 해결 방법 |
|---|
| catalog를 가격 데이터로 간주함 | 가격 및 기능 세부 정보는 model directory를 사용하세요. |
| 오래된 model ID를 재사용함 | 배포 또는 시작 시점에 catalog를 가져오세요. |
/api/models와 /v1/models를 혼동함 | 공개 catalog에는 /api/models를 사용하세요. OpenAI 호환 모델 목록 형태가 필요할 때만 인증된 /v1/models를 사용하세요. |
| 모델 유형에 맞지 않는 엔드포인트 사용 | 모델 기능에 맞는 API 레퍼런스 페이지를 선택하세요. |
관련 링크