/v1/account

account

계정: API로 잔액, 사용량, 크레딧 구독, API 키 관리.

비용과 한도

비용과 한도
항목 크레딧
계정, 잔액, 사용량, 크레딧 구독 조회 무료

한도: 분당 30 요청. 생성, 수정, 삭제: 분당 10.

엔드포인트

메서드
메서드 경로 용도 접근
GET /v1/account 내 계정. API 키
GET /v1/account/credits 잔액과 만료일. API 키
GET /v1/account/usage 기간 내 사용량 합계. API 키
GET /v1/account/usage/transactions 비용이 담긴 개별 요청. API 키
GET /v1/account/subscription 내 크레딧 구독. API 키
GET /v1/account/api-keys 내 API 키. API 키
POST /v1/account/api-keys 새 API 키. 관리자 토큰
DELETE /v1/account/api-keys/{id} API 키 삭제. 관리자 토큰
POST /v1/auth/tokens/create Bearer 토큰 생성. API 키
GET · DELETE /v1/auth/tokens Bearer 토큰 목록과 폐기. API 키

계정

curl -G "https://handelsregister.ai/api/v1/account" \
  -H "x-api-key: YOUR_API_KEY"
1{2  "account": {3    "id": 2,4    "name": "Max Mustermann",5    "email": "[email protected]",6    "email_verified": true,7    "language": "de",8    "plan": "max",9    "member_since": "2026-09-02T17:07:10+00:00"10  },11  "meta": {12    "request_credit_cost": 0,13    "credits_remaining": 14514  }15}
200 · Max 계정의 예시 응답

잔액

curl -G "https://handelsregister.ai/api/v1/account/credits" \
  -H "x-api-key: YOUR_API_KEY"
필드
필드 의미
balance.total 전체 잔액.
balance.subscription 플랜 변경 시 이월된 것(rollover)을 포함한 크레딧 구독의 크레딧.
balance.purchased 충전 크레딧과 시작 크레딧.
next_expiry 다음으로 만료되는 크레딧, amount와 expires_at 포함. 만료되는 것이 없으면 null.
breakdown 남은 금액 amount, 출처 source, 만료일 valid_until이 담긴 모든 크레딧 지급 내역. source는 subscription, rollover, purchase, registration 중 하나예요.
1{2  "balance": {3    "total": 145,4    "subscription": 0,5    "purchased": 1456  },7  "next_expiry": null,8  "meta": {9    "request_credit_cost": 0,10    "credits_remaining": 14511  }12}
200 · 예시 응답: 계정의 잔액
잔액 부족 알림을 만들려면 balance.total을 정기적으로 조회하세요. 비용이 들지 않아요.

사용량

curl -G "https://handelsregister.ai/api/v1/account/usage" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode 'from=2026-11-01' \
  --data-urlencode 'group_by=day'
파라미터
이름 타입 설명 예시
fromQuery 문자열선택 YYYY-MM-DD 또는 ISO 8601 형식의 시작. 생략하면 이번 달 초. 2026-11-01
toQuery 문자열선택 끝, 해당일 포함. 날짜만 쓰면 그날 끝까지 포함돼요. 생략하면 지금. –
group_byQuery 문자열선택 생략하면 API가 92일 이하의 기간은 일별로, 더 긴 기간은 월별로 묶어요.값: day, month day
1{2  "period": {3    "from": "2026-11-01T00:00:00+00:00",4    "to": "2026-11-01T07:54:44+00:00"5  },6  "totals": {7    "requests": 80,8    "credits_used": 3209  },10  "by_endpoint": [11    {12      "endpoint": "/api/v1/signals",13      "requests": 7,14      "credits_used": 14015    },16    {17      "endpoint": "/api/v1/fetch-organization",18      "requests": 25,19      "credits_used": 12020    },21    {22      "endpoint": "/api/v1/search-companies",23      "requests": 47,24      "credits_used": 4025    },26    {27      "endpoint": "/api/v1/signals/e23c12835d697c00512944ebdfb8260f",28      "requests": 1,29      "credits_used": 2030    }31  ],32  "series": {33    "group_by": "day",34    "buckets": [35      {36        "date": "2026-11-01",37        "requests": 80,38        "credits_used": 32039      }40    ]41  },42  "meta": {43    "request_credit_cost": 0,44    "credits_remaining": 14545  }46}
200 · 예시 응답: 하루의 사용량

개별 요청

curl -G "https://handelsregister.ai/api/v1/account/usage/transactions" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode 'per_page=3'
파라미터
이름 타입 설명 예시
fromQuery 문자열선택 YYYY-MM-DD 또는 ISO 8601 형식의 시작. 생략하면 이번 달 초. –
toQuery 문자열선택 끝, 해당일 포함. 날짜만 쓰면 그날 끝까지 포함돼요. 생략하면 지금. –
endpointQuery 문자열선택 endpoint에 나오는 것과 정확히 같은 레이블의 요청만. –
per_pageQuery 정수선택 페이지당 항목 수. 더 큰 값은 API가 100로 낮춰요.기본값: 25제한: 최소 1 3
cursorQuery 문자열선택 다음 페이지를 위한, 이전 페이지의 pagination.next_cursor 값. –
1{2  "transactions": [3    {4      "id": 1116,5      "endpoint": "/api/v1/search-companies",6      "credits": 1,7      "parameters": {8        "q": "",9        "ai_search": false,10        "filters": {11          "postal_code": "91710",12          "active": true13        },14        "sort": null,15        "order": null,16        "status": 200,17        "search_type": "standard"18      },19      "created_at": "2026-11-01T07:55:02+00:00",20      "api_key_id": 1021    },22    {23      "id": 1115,24      "endpoint": "/api/v1/search-companies",25      "credits": 1,26      "parameters": {27        "q": "",28        "ai_search": false,29        "filters": {30          "postal_code": "91710",31          "active": true32        },33        "sort": null,34        "order": null,35        "status": 200,36        "search_type": "standard"37      },38      "created_at": "2026-11-01T07:55:01+00:00",39      "api_key_id": 1040    },41    {42      "id": 1114,43      "endpoint": "/api/v1/search-companies",44      "credits": 1,45      "parameters": {46        "q": "",47        "ai_search": false,48        "filters": {49          "industry_code": "62.1"50        },51        "sort": null,52        "order": null,53        "status": 200,54        "search_type": "standard"55      },56      "created_at": "2026-11-01T07:55:00+00:00",57      "api_key_id": 1058    }59  ],60  "pagination": {61    "per_page": 3,62    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0xMS0wMSAwNzo1NTowMCIsImlkIjoxMTE0LCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9"63  },64  "period": {65    "from": "2026-11-01T00:00:00+00:00",66    "to": "2026-11-01T07:55:02+00:00"67  },68  "meta": {69    "request_credit_cost": 0,70    "credits_remaining": 14571  }72}
200 · 예시 응답: 최신 요청 세 건

크레딧 구독

curl -G "https://handelsregister.ai/api/v1/account/subscription" \
  -H "x-api-key: YOUR_API_KEY"
1{2  "subscription": {3    "plan": "max",4    "status": "active",5    "billing_interval": "month",6    "cancel_at_period_end": false,7    "current_period_start": "2026-10-26T21:51:51+00:00",8    "current_period_end": "2026-11-26T21:51:51+00:00",9    "trial_ends_at": null,10    "canceled_at": null,11    "features": {12      "credits_per_month": 75000,13      "bonus_percentage": 15,14      "non_expiring_credits": true,15      "support_level": "priority"16    }17  },18  "meta": {19    "request_credit_cost": 0,20    "credits_remaining": 14521  }22}
200 · 예시 응답: 활성 Max 크레딧 구독

API 키 관리

curl -G "https://handelsregister.ai/api/v1/account/api-keys" \
  -H "x-api-key: YOUR_API_KEY"
1{2  "api_keys": [3    {4      "id": 10,5      "key_last_8": "Ab12Cd34",6      "is_current": true,7      "created_at": "2026-11-01T04:17:31+00:00",8      "last_used_at": "2026-11-01T07:55:12+00:00",9      "usage_last_30d": {10        "requests": 97,11        "credits_used": 41112      }13    }14  ],15  "total": 1,16  "meta": {17    "request_credit_cost": 0,18    "credits_remaining": 14519  }20}
200 · 예시 응답: 계정의 API 키
curl -X POST "https://handelsregister.ai/api/v1/account/api-keys" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"
1{2  "api_key": {3    "id": 13,4    "key": "…",5    "created_at": "2026-11-01T08:32:00+00:00"6  },7  "meta": {8    "message": "Store this key securely. It grants full data access to this account.",9    "request_credit_cost": 0,10    "credits_remaining": 14511  }12}
201 · 예시 응답: 새 API 키, 여기서는 줄여 표시

Bearer 토큰

curl -X POST "https://handelsregister.ai/api/v1/auth/tokens/create" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "token_name": "CRM-Sync",
    "abilities": [
        "api:data",
        "account:read"
    ]
}'
파라미터
이름 타입 설명 예시
token_nameBody 문자열필수 토큰을 알아볼 수 있는 이름, 예: 애플리케이션 이름.제한: 최대 255자 CRM-Sync
abilitiesBody string 목록선택 권한 목록. 생략하면 토큰은 데이터 엔드포인트용 api:data와 계정 엔드포인트용 account:read를 받아요. monitoring:manage는 모니터 변경을 허용해요.기본값: ["*"] ["api:data","account:read"]
expires_atBody 문자열 (date-time)선택 미래의 만료일. 생략하면 폐기할 때까지 유효해요. –
1{2  "token": "…",3  "name": "CRM-Sync",4  "abilities": [5    "api:data",6    "account:read"7  ],8  "expires_at": null,9  "created_at": "2026-11-01T08:31:26.000000Z",10  "meta": {11    "message": "Token created successfully. Store this token securely as it will not be shown again.",12    "credits_remaining": 14513  }14}
201 · 예시 응답: 새 토큰, 여기서는 줄여 표시
DELETE /v1/auth/tokens는 관리자 토큰을 포함해 모든 토큰을 한 번에 폐기해요. 그 뒤에 키를 관리하려면 새 관리자 토큰이 필요해요.

오류

오류
상태 원인 해결 방법
400 URL에 api_key가 있어요. 키를 헤더 x-api-key로 보내세요.
400 날짜, group_by, 너무 긴 기간 같은 파라미터가 유효하지 않아요. meta.message의 설명대로 값을 고치세요.
401 API 키나 토큰이 없거나 유효하지 않아요. 키를 헤더 x-api-key로 보내세요.
401 API 키가 없거나 유효하지 않아요. /v1/auth 아래에서는 Bearer 토큰이 동작하지 않아요. API 키를 헤더 x-api-key로 보내세요.
403 Bearer 토큰에 account:read 권한이 없어요. API 키나 account:read가 있는 토큰을 쓰세요.
403 계정의 이메일 주소가 아직 인증되지 않았거나 계정이 잠겼어요. 인증 이메일의 링크를 여세요. 계정이 잠겼다면 지원팀이 도와드려요.
403 이 호출에는 관리자 토큰이 필요해요. API 키로도, 다른 토큰으로도 안 돼요. Authorization: Bearer와 관리자 토큰으로 보내세요.
404 이 ID의 키나 토큰이 없어요. 목록에서 ID를 가져오세요.
422 API 키의 최대 개수에 도달했어요(too_many_keys). 오래된 키를 삭제하세요.
429 요청이 너무 많아요. Retry-After 이후에 다시 시도하세요.
500 값이 유효하지 않아요: token_name이 없거나 너무 길거나, abilities가 목록이 아니거나, expires_at이 미래가 아니에요. 값을 고치세요. Accept: application/json을 보내면 오류가 JSON으로 와요.
1{2  "error": "invalid_request",3  "meta": {4    "message": "'group_by' must be one of: day, month.",5    "request_credit_cost": 0,6    "credits_remaining": 1457  }8}
400 · group_by에 유효하지 않은 값