BazaarLinkBazaarLink
로그인
문서API 레퍼런스SDK 레퍼런스에이전트 사용법AI 스킬
목차

관리 API 키

관리 API 키

관리 키는 프로그래밍 방식의 키 관리를 위해 설계되었습니다. 표준 API 키를 생성, 나열, 업데이트, 비활성화, 삭제할 수 있지만 — AI 모델 호출은 불가합니다.

참고
관리 키로는 AI 모델(chat/completions/messages/embeddings)을 호출할 수 없습니다. 모델 접근에는 표준 API 키를 사용하세요.

관리 키 생성

Management API Keys 페이지로 이동하여 "Create"를 클릭하세요 — 일반 API Keys 페이지의 유형 선택이 아니라 별도의 페이지입니다.

키 목록

GET https://api.bazaarlink.ai/v1/keys
Authorization: Bearer sk-bl-YOUR_MGMT_KEY

# Response
{
"keys": [
  {
    "id": "clxyz123...",
    "name": "Production Key",
    "keyType": "standard",
    "keyPrefix": "sk-bl-abc1",
    "keySuffix": "XyZ9",
    "enabled": true,
    "spendLimitUsd": 10.00,
    "spendLimitPeriod": "month",
    "expiresAt": null,
    "createdAt": "2026-01-01T00:00:00.000Z",
    "lastUsed": "2026-03-01T12:34:56.000Z",
    "requestCount": 1234,
    "totalTokens": 5678901
  }
]
}

하위 키 생성

POST https://api.bazaarlink.ai/v1/keys
Authorization: Bearer sk-bl-YOUR_MGMT_KEY
Content-Type: application/json

{
"name": "Agent Key",
"limit": 10.00,
"limit_reset": "monthly",
"expires_at": "2026-12-31T23:59:59Z"
}

# limit_reset: daily | weekly | monthly
# expires_at:  ISO 8601 datetime (optional)

# Response — save the key value, it won't be shown again
{
"id": "clxyz789...",
"name": "Agent Key",
"key": "sk-bl-xyz789abcdef...",
"keyType": "standard",
"spendLimitUsd": 10.00,
"spendLimitPeriod": "month",
"expiresAt": "2026-12-31T23:59:59.000Z",
"enabled": true,
"createdAt": "2026-03-01T00:00:00.000Z"
}

키 업데이트

PATCH https://api.bazaarlink.ai/v1/keys/:id
Authorization: Bearer sk-bl-YOUR_MGMT_KEY
Content-Type: application/json

{"enabled": false}              # disable key
{"spendLimitUsd": 5, "spendLimitPeriod": "week"}  # set spend limit
{"spendLimitUsd": null}         # remove spend limit
# Response: {"updated": true}

키 해지

DELETE https://api.bazaarlink.ai/v1/keys/:id
Authorization: Bearer sk-bl-YOUR_MGMT_KEY

# Returns 204 No Content on success

잔액 조회

GET https://api.bazaarlink.ai/v1/credits
Authorization: Bearer sk-bl-YOUR_MGMT_KEY

# Response
{
"data": {
  "total_credits": 12.345,
  "total_usage": 3.210
}
}

사용량 조회

GET https://api.bazaarlink.ai/v1/usage?period=month
Authorization: Bearer sk-bl-YOUR_MGMT_KEY

# period: day | week | month | year
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
관리 API 키 | BazaarLink