메인 콘텐츠로 건너뛰기

Documentation Index

Fetch the complete documentation index at: https://docs.llmgenerator.com/llms.txt

Use this file to discover all available pages before exploring further.

POST /credits/checkout

사용자가 크레딧 패키지를 결제할 수 있도록 Stripe Checkout 세션을 생성합니다. 세션 기반 인증(로그인으로 받은 JWT 액세스 토큰)이 필요합니다.
서드파티 연동: API 키 인증을 사용할 때는 대신 POST /credits/checkout/api를 사용하세요.

요청 본문

packageId
string
필수
구매할 크레딧 패키지 ID입니다. 가능한 패키지는 /credits/packages에서 확인합니다.
successUrl
string
결제 성공 후 리디렉션할 URL입니다. 기본값은 대시보드의 성공 표시 페이지입니다.
cancelUrl
string
결제 취소 시 리디렉션할 URL입니다. 기본값은 대시보드의 취소 표시 페이지입니다.

응답

sessionId
string
Stripe Checkout 세션 ID입니다.
url
string
Stripe 결제 페이지 URL입니다. 사용자를 이 주소로 보내 결제를 완료하게 합니다.
package
object
선택한 패키지 정보입니다.
curl -X POST https://api.llmgenerator.com/api/v1/credits/checkout \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "packageId": "pkg_pro",
        "successUrl": "https://example.com/success?session_id={CHECKOUT_SESSION_ID}",
        "cancelUrl": "https://example.com/cancel"
      }'
{
  "sessionId": "cs_test_a1b2c3d4e5f6g7h8i9j0",
  "url": "https://checkout.stripe.com/c/pay/cs_test_a1b2c3d4e5f6g7h8i9j0",
  "package": {
    "id": "pkg_pro",
    "name": "Pro Pack",
    "credits": 500,
    "priceCents": 1999
  }
}

POST /credits/checkout/api

API 키 인증으로 Stripe Checkout 세션을 생성합니다. 서드파티 연동에 적합합니다.

인증

API 키 인증이 필요합니다. Authorization 헤더에 API 키를 넣습니다:
Authorization: Bearer llmgen_your_api_key_here

요청 본문

/credits/checkout와 동일합니다.

응답

/credits/checkout와 동일합니다.
curl -X POST https://api.llmgenerator.com/api/v1/credits/checkout/api \
  -H "Authorization: Bearer llmgen_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
        "packageId": "pkg_pro",
        "successUrl": "https://yourapp.com/success?session_id={CHECKOUT_SESSION_ID}",
        "cancelUrl": "https://yourapp.com/cancel"
      }'