메인 콘텐츠로 건너뛰기
POST
이 엔드포인트를 사용하여 자동화, 내부 대시보드 또는 서버 측 통합을 위한 API 키를 생성합니다.
api_key:write 권한이 있는 개인 액세스 토큰을 다음 위치에서 생성하세요: 콘솔 → 개인 설정토큰을 원시 Authorization 헤더 값으로 전송하세요. Bearer 접두사를 추가하지 마세요.
성공 응답에는 생성된 API 키 레코드가 data에 포함되며, 숫자 ID는 data.id에, 전체 API 키는 data.key에 포함됩니다.
data.key을 즉시 저장하세요. 이후의 목록, 세부 정보 및 업데이트 응답에는 모델 요청을 인증할 수 없는 마스킹된 API 키가 포함됩니다.
모델 요청에는 반환된 data.key을 Authorization: Bearer <COMETAPI_KEY>로 변경 없이 사용하세요. sk- 접두사를 추가하지 마세요. 전체 API 키를 저장하지 않았다면 다음을 여세요: 콘솔 → API 키. 생성한 API 키를 찾아 복사를 선택하고 신원 확인을 완료하세요.

생성 응답

요청 본문

허용 목록 형식

여러 IP 또는 CIDR 범위를 허용하려면 항목 사이에 \n를 넣은 하나의 JSON 문자열로 전송하세요:
이 예에서는 IPv4 주소 하나, IPv4 CIDR 범위 하나 및 IPv6 CIDR 범위 하나를 허용합니다.

인증

Authorization
string
header
필수

Personal access token with the api_key:write permission, generated in CometAPI Console > Personal Settings. Send the raw token value; do not prefix it with Bearer.

본문

application/json
name
string

User-readable display name for the API key. The backend accepts up to 50 Unicode characters; longer names return success: false with token name is too long.

Maximum string length: 50
예시:

"production"

expired_time
integer

Unix timestamp in seconds when the key expires. Use -1 for no expiration. A past timestamp blocks model requests with this key.

예시:

-1

remain_quota
integer

Starting quota for the new key in CometAPI internal quota units. If this reaches 0 while unlimited_quota is false, model requests with this key are rejected as quota exhausted.

예시:

100000

unlimited_quota
boolean

Whether the key bypasses remaining-quota checks. Set true only when the key should keep working even if remain_quota is 0.

예시:

false

model_limits_enabled
boolean

Whether to restrict this key to specific models. When true, only model IDs listed in model_limits are allowed. When false, model_limits is ignored.

예시:

false

model_limits
string

Comma-separated model IDs allowed by this key when model_limits_enabled is true. Use model IDs returned by /v1/models, for example <model-id-1>,<model-id-2>. Use an empty string for no model restriction.

예시:

""

allow_ips
string | null

Optional IP allowlist. Provide one JSON string with entries separated by newline characters (\n). Each entry can be a single IPv4 address, single IPv6 address, IPv4 CIDR, or IPv6 CIDR. Example for three allowlist entries: 198.51.100.10\n203.0.113.0/24\n2001:db8::/32. CometAPI compares the model request client IP to this list. Use null or "" to disable IP restrictions.

예시:

"198.51.100.10\n203.0.113.0/24\n2001:db8::/32"

group
string

Optional account group restriction. Use an empty string for no explicit group restriction. Non-empty values must be available to the account, or the API returns success: false with a no access to group message.

예시:

""

cross_group_retry
boolean

Whether cross-group retry is enabled for automatic group routing. This is only meaningful when the key uses an auto-routed group such as auto.

예시:

false

응답

200 - application/json

Creation result. Successful responses include the created record and complete API key in data.

success
boolean
필수

Whether the create operation succeeded.

예시:

true

message
string
필수

Backend status message. The value is usually an empty string on success.

예시:

""

data
object

Created API key record, including id and the complete key. Present when success is true.

마지막 수정일 2026년 10월 26일