Skip to main content
GET
/
credits
/
verify-session
/
{sessionId}
curl -X GET https://api.llmgenerator.com/api/v1/credits/verify-session/cs_test_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "success": true,
  "credits": 500,
  "sessionId": "cs_test_a1b2c3d4e5f6"
}

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.

Overview

After a successful checkout, use this endpoint to verify the payment was processed and credits were added to the account. This is useful as a fallback in case the webhook wasn’t processed.
Credits are typically added automatically via Stripe webhooks. This endpoint provides a manual verification option for edge cases or client-side confirmation.
For third-party integrations: Use GET /credits/verify-session/{sessionId}/api with API Key authentication instead.

Authentication

Authorization
string
required
Your JWT access token (session auth). Format: Bearer YOUR_ACCESS_TOKEN

Path Parameters

sessionId
string
required
The Stripe checkout session ID returned from /credits/checkout.
curl -X GET https://api.llmgenerator.com/api/v1/credits/verify-session/cs_test_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "success": true,
  "credits": 500,
  "sessionId": "cs_test_a1b2c3d4e5f6"
}

Response Fields

success
boolean
Whether the session verification was successful.
credits
integer
Number of credits from the purchase.
sessionId
string
The verified session ID.

Error Responses

400
Bad Request - Payment not completed or invalid session metadata.
401
Unauthorized - Invalid or missing token.
403
Forbidden - Session does not belong to the authenticated user.

Idempotency

This endpoint is idempotent. If the credits were already added (via webhook), it will not add them again. It will still return success with the credit amount.

Typical Flow

  1. User completes checkout at Stripe
  2. Stripe redirects to your successUrl
  3. Call this endpoint to verify and confirm credits
  4. Display confirmation to user
  5. Refresh credit balance in your UI
While this endpoint is available, the recommended flow is to listen for Stripe webhooks and update your UI based on the /credits/balance endpoint.

GET /credits/verify-session//api

This endpoint verifies a checkout session using API Key authentication. Ideal for third-party integrations.

Authentication

Requires API Key authentication. Include your API key in the Authorization header:
Authorization: Bearer llmgen_your_api_key_here

Path Parameters

Same as above.

Response

Same as above.
curl -X GET https://api.llmgenerator.com/api/v1/credits/verify-session/cs_test_a1b2c3d4e5f6/api \
  -H "Authorization: Bearer llmgen_your_api_key_here"