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

BYOK 키 생성

조직용 BYOK 업스트림 키를 생성하고 즉시 모델 카탈로그를 동기화합니다. 업스트림 apiKey는 이 요청에서만 평문으로 나타나며 저장 시 암호화되고 이후에는 마스킹 형태(keyMask)로만 반환됩니다. 성공 시 201과 함께 키 객체 및 동기화 결과(sync)를 반환합니다.

POST/api/v1/management/byok-keys

인증

Authorization필수
string · header

Authorization 헤더에 Bearer 토큰으로 API 키를 전달합니다.

Body

name필수
string

키의 표시 이름.

1-200 chars
baseUrl필수
string

업스트림 공급자의 API base URL. 사설/로컬 주소는 거부됩니다(400).

1-2000 chars, public HTTPS endpoint
apiKey필수
string

업스트림 공급자의 API 키 평문. 이 요청에만 나타나며 암호화 저장되고 이후 keyMask만 반환됩니다.

1-2000 chars
protocol
string

업스트림의 API 인터페이스 프로토콜, 기본 openai.

openaianthropic
Example: "openai"
fallbackMode
string

업스트림 실패 시 동작: seamless(기본)=플랫폼 라우팅으로 폴백; strict=폴백 없이 오류 반환.

seamlessstrict
Example: "seamless"
disabledCanonicalIds
string[]

생성 시 비활성화할 모델(canonical id) 목록; 동기화 후 이 모델들은 이 키로 라우팅되지 않습니다.

≤2000 items
scopedApiKeyIds
string[]

이 BYOK를 특정 플랫폼 API 키(키 id)에만 적용하도록 제한합니다. 비움/생략=조직의 모든 키에 적용. 소유하지 않은 키 id 포함 시 거부(400).

≤200 items; must be your own keys
POST /api/v1/management/byok-keys
curl https://bazaarlink.ai/api/v1/management/byok-keys \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "team-upstream",
    "baseUrl": "https://api.example-upstream.com/v1",
    "apiKey": "'$UPSTREAM_API_KEY'",
    "protocol": "openai",
    "fallbackMode": "seamless"
  }'
응답 예시

생성됨. key는 키 객체(keyMask만 포함); sync는 카탈로그 동기화 결과를 보고합니다: matched(플랫폼 카탈로그에 매핑된 모델 수), unmatched(카탈로그에 없는 업스트림 모델 id), stale(추후 재동기화 필요 여부).

{
  "key": {
    "id": "byok_abc123",
    "ownerType": "org",
    "userId": null,
    "organizationId": "org_abc123",
    "name": "team-upstream",
    "baseUrl": "https://api.example-upstream.com/v1",
    "keyMask": "sk-abc…wxyz",
    "protocol": "openai",
    "enabled": true,
    "fallbackMode": "seamless",
    "modelsStale": false,
    "lastVerifiedAt": "2026-07-29T00:00:00.000Z",
    "lastErrorAt": null,
    "lastErrorCode": null,
    "errorCount1h": 0,
    "createdAt": "2026-07-29T00:00:00.000Z",
    "updatedAt": "2026-07-29T00:00:00.000Z",
    "models": [
      {
        "canonicalId": "openai/gpt-4o",
        "upstreamModelId": "gpt-4o",
        "enabled": true
      }
    ],
    "scopedApiKeyIds": []
  },
  "sync": {
    "matched": 12,
    "unmatched": [
      "internal-model-x"
    ],
    "stale": false
  }
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
BYOK 키 생성 — BazaarLink API