---
title: "API 키 | Tajo"
description: "Brevo API 키 인증에 대한 완전한 가이드"
url: https://tajo.io/kr/docs/authentication/api-keys/
markdown: https://tajo.io/kr/docs/authentication/api-keys.md
lang: ko-KR
author: "Set Noa"
author_url: https://tajo.io/kr/set-noa/
robots: noindex
---

Tajo 사전 이용 신청

이름과 회사 이메일 주소를 입력하세요. Tajo 이용 신청을 확인할 수 있는 링크를 이메일로 보내드립니다.

# API 키

[Set Noa](https://tajo.io/kr/set-noa/)

API 키는 Brevo API 인증에 사용하는 기본 수단입니다. 프로그래밍 방식으로 계정에 접근하는 간단하고 안전한 방법을 제공합니다.

## API 키란?

API 키는 Brevo API에 요청을 보낼 때 애플리케이션을 인증하는 고유 식별자입니다. 각 키는 64자 문자열이며, 식별자와 비밀번호 역할을 동시에 합니다.

```
Example API key: xkeysib-a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456-Ab1Cd2Ef3Gh4
```

## API 키 생성하기

### 단계별 가이드

1. **Brevo에 로그인**: [Brevo 대시보드](https://app.brevo.com/)에 접속합니다
2. **설정으로 이동**: 프로필 → 설정을 클릭합니다
3. **API 키로 이동**: 왼쪽 메뉴에서 “API Keys”를 선택합니다
4. **새 키 생성**: “Generate a New API Key”를 클릭합니다
5. **키 이름 지정**: 용도를 알 수 있는 이름을 지정합니다 (예: “Production App”, “Development Testing”)
6. **권한 설정**: 적절한 접근 수준을 선택합니다
7. **생성**: “Generate”를 클릭하고 키를 즉시 복사합니다

### API 키 이름 규칙

키의 용도를 알아볼 수 있는 이름을 사용합니다:

- `production-web-app`
- `staging-environment`
- `mobile-app-ios`
- `webhook-listener`
- `data-sync-service`

## API 키 유형과 권한

### 전체 접근 키

```
Permissions: All API endpoints
Use cases: Complete application integration
Risk level: High - protect carefully
```

### 읽기 전용 키

```
Permissions: GET requests only
Use cases: Analytics, reporting, dashboards
Risk level: Low - limited access
```

### 발송 전용 키

```
Permissions: Transactional email sending
Use cases: Application notifications, receipts
Risk level: Medium - can send emails
```

### 연락처 관리 키

```
Permissions: Contact CRUD operations
Use cases: CRM integrations, form submissions
Risk level: Medium - data modification
```

## API 키 사용하기

### 헤더 인증

`api-key` 헤더에 API 키를 포함합니다:

```http
GET /v3/account HTTP/1.1
Host: api.brevo.com
Accept: application/json
Content-Type: application/json
api-key: YOUR_API_KEY
```

### 코드 예시

#### JavaScript/Node.js

```javascript
const brevo = require('@getbrevo/brevo');

const apiInstance = new brevo.AccountApi();
apiInstance.setApiKey(brevo.AccountApiApiKeys.apiKey, process.env.BREVO_API_KEY);

// Make authenticated request
apiInstance.getAccount()
  .then(data => console.log('Account info:', data))
  .catch(error => console.error('Error:', error));
```

#### Python

```python
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException

# Configure API key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'

# Create API instance
api_instance = sib_api_v3_sdk.AccountApi(sib_api_v3_sdk.ApiClient(configuration))

try:
    # Get account info
    api_response = api_instance.get_account()
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->get_account: %s\n" % e)
```

#### PHP

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key
$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');

// Create API instance
$apiInstance = new SendinBlue\Client\Api\AccountApi(
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getAccount();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}
?>
```

#### Ruby

```ruby
require 'sib-api-v3-sdk'

# Configure API key
SibApiV3Sdk.configure do |config|
  config.api_key['api-key'] = 'YOUR_API_KEY'
end

# Create API instance
api_instance = SibApiV3Sdk::AccountApi.new

begin
  # Get account info
  result = api_instance.get_account
  puts result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling AccountApi->get_account: #{e}"
end
```

## API 키 보안

### 안전한 저장

**환경 변수** (권장)

```bash
# .env file
BREVO_API_KEY=xkeysib-your-api-key-here

# Usage in code
const apiKey = process.env.BREVO_API_KEY;
```

**클라우드 시크릿 관리자**

- AWS Secrets Manager
- Google Secret Manager
- Azure Key Vault
- HashiCorp Vault

### 보안 모범 사례

1. **키를 절대 하드코딩하지 마세요**

   ```javascript
   // ❌ Bad - hardcoded
   const apiKey = "xkeysib-a1b2c3d4...";

   // ✅ Good - environment variable
   const apiKey = process.env.BREVO_API_KEY;
   ```

2. **환경마다 다른 키를 사용하세요**

   ```
   Production:  BREVO_API_KEY_PROD
   Staging:     BREVO_API_KEY_STAGING
   Development: BREVO_API_KEY_DEV
   ```

3. **키를 주기적으로 교체하세요**

   - 분기별 교체 일정을 캘린더 알림으로 설정합니다
   - 키 교체에 자동화 도구를 사용합니다
   - 롤백 계획을 미리 준비합니다

4. **키 사용량을 모니터링하세요**

   - 비정상적인 활동에 대한 알림을 설정합니다
   - 매월 키 사용 로그를 검토합니다
   - 지역별 접근 패턴을 추적합니다

## 키 관리

### 활성 키 모니터링

대시보드에서 활성 키를 모니터링합니다:

```
Key Name: production-web-app
Created: 2024-01-15
Last Used: 2024-01-20 14:30 UTC
Requests Today: 1,247
Status: Active
```

### 키 교체 절차

1. **새 키 생성**: 교체용 키를 만듭니다
2. **설정 업데이트**: 새 키로 배포합니다
3. **모니터링**: 새 키가 정상적으로 동작하는지 확인합니다
4. **유예 기간**: 기존 키를 24~48시간 동안 활성 상태로 둡니다
5. **기존 키 폐기**: 이전 키를 삭제합니다

### 긴급 키 폐기

키가 유출된 경우:

1. **즉시 폐기**: 대시보드에서 키를 삭제합니다
2. **대체 키 생성**: 즉시 새 키를 만듭니다
3. **애플리케이션 업데이트**: 가능한 한 빨리 새 키로 배포합니다
4. **활동 모니터링**: 무단 사용이 있었는지 확인합니다
5. **사고 보고**: 보안 사고를 문서로 남깁니다

## 요청 한도와 API 키

Brevo는 하루 단위가 아니라 엔드포인트별로 요청을 제한합니다. 모든 요금제에 적용되는 일반 등급에서 `POST /v3/smtp/email`은 초당 1,000회, `/v3/contacts` 엔드포인트는 초당 10회와 시간당 36,000회, 자체 제한이 없는 엔드포인트는 시간당 100회를 허용합니다. Professional 및 Enterprise 요금제는 더 높은 등급을 사용할 수 있습니다. 전체 표는 [요청 한도](https://tajo.io/kr/docs/rate-limits/)를 참조하세요.

### 요청 한도 헤더

```http
HTTP/1.1 200 OK
x-sib-ratelimit-limit: 1000
x-sib-ratelimit-remaining: 750
x-sib-ratelimit-reset: 1
```

### 요청 한도 처리

```javascript
async function makeApiCall() {
  try {
    const response = await fetch(url, { headers });

    if (response.status === 429) {
      // Seconds until the window resets
      const waitTime = Number(response.headers.get('x-sib-ratelimit-reset') || 1);

      console.log(`Rate limited. Waiting ${waitTime} seconds`);
      await new Promise(resolve => setTimeout(resolve, waitTime * 1000));

      // Retry the request
      return makeApiCall();
    }

    return response.json();
  } catch (error) {
    console.error('API call failed:', error);
    throw error;
  }
}
```

## API 키 문제 해결

### 자주 발생하는 오류 메시지

**잘못된 API 키 (401)**

```json
{
  "code": "unauthorized",
  "message": "Invalid API key provided"
}
```

**권한 부족 (403)**

```json
{
  "code": "permission_denied",
  "message": "API key does not have required permissions"
}
```

**요청 한도 초과 (429)**

```json
{
  "code": "too_many_requests",
  "message": "Rate limit exceeded for API key"
}
```

### 디버깅 체크리스트

- 키 형식이 올바른가 (64자)
- 불필요한 공백이나 숨은 문자가 없는가
- 키에 필요한 권한이 있는가
- 키가 활성 상태인가 (폐기되지 않았는가)
- 요청 한도 이내인가
- 올바른 API 엔드포인트를 사용하고 있는가
- 헤더 형식이 올바른가

## 다음 단계

- [OAuth 2.0 알아보기](https://tajo.io/kr/docs/authentication/oauth/)
- JWT 토큰 이해하기
- [요청 한도 살펴보기](https://tajo.io/kr/docs/rate-limits/)
- [SDK 사용해 보기](https://tajo.io/kr/docs/sdks-libraries/)
