curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/current', {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
const data = await response.json();
import requests
response = requests.get(
'https://api.llmgenerator.com/api/v1/subscriptions/current',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
)
data = response.json()
{
"hasSubscription": true,
"subscription": {
"plan": "professional",
"status": "active",
"billingCycle": "monthly",
"currentPeriodStart": "2024-01-15T00:00:00Z",
"currentPeriodEnd": "2024-02-15T00:00:00Z",
"cancelAtPeriodEnd": false
},
"planDetails": {
"id": "professional",
"name": "Professional",
"monthlyCredits": 3000,
"price": 12.99,
"features": [
"3,000 credits/month",
"Priority support",
"Advanced analytics"
]
}
}
{
"hasSubscription": false,
"subscription": null,
"planDetails": null
}
{
"hasSubscription": true,
"subscription": {
"plan": "professional",
"status": "active",
"billingCycle": "monthly",
"currentPeriodStart": "2024-01-15T00:00:00Z",
"currentPeriodEnd": "2024-02-15T00:00:00Z",
"cancelAtPeriodEnd": true
},
"planDetails": {
"id": "professional",
"name": "Professional",
"monthlyCredits": 3000,
"price": 12.99,
"features": [...]
}
}
サブスクリプション
現在の契約の取得
認証済みユーザーの現在の契約状態と詳細を返します。
GET
/
subscriptions
/
current
curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/current', {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
const data = await response.json();
import requests
response = requests.get(
'https://api.llmgenerator.com/api/v1/subscriptions/current',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
)
data = response.json()
{
"hasSubscription": true,
"subscription": {
"plan": "professional",
"status": "active",
"billingCycle": "monthly",
"currentPeriodStart": "2024-01-15T00:00:00Z",
"currentPeriodEnd": "2024-02-15T00:00:00Z",
"cancelAtPeriodEnd": false
},
"planDetails": {
"id": "professional",
"name": "Professional",
"monthlyCredits": 3000,
"price": 12.99,
"features": [
"3,000 credits/month",
"Priority support",
"Advanced analytics"
]
}
}
{
"hasSubscription": false,
"subscription": null,
"planDetails": null
}
{
"hasSubscription": true,
"subscription": {
"plan": "professional",
"status": "active",
"billingCycle": "monthly",
"currentPeriodStart": "2024-01-15T00:00:00Z",
"currentPeriodEnd": "2024-02-15T00:00:00Z",
"cancelAtPeriodEnd": true
},
"planDetails": {
"id": "professional",
"name": "Professional",
"monthlyCredits": 3000,
"price": 12.99,
"features": [...]
}
}
概要
プラン内容、請求サイクル、更新日など、現在の契約情報を返します。セッション認証(JWT アクセストークン)が必要です。サードパーティ連携: API キー認証で
GET /subscriptions/current/api を利用してください。認証
string
必須
JWT アクセストークン。形式:
Bearer YOUR_ACCESS_TOKENcurl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/current', {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
const data = await response.json();
import requests
response = requests.get(
'https://api.llmgenerator.com/api/v1/subscriptions/current',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
)
data = response.json()
{
"hasSubscription": true,
"subscription": {
"plan": "professional",
"status": "active",
"billingCycle": "monthly",
"currentPeriodStart": "2024-01-15T00:00:00Z",
"currentPeriodEnd": "2024-02-15T00:00:00Z",
"cancelAtPeriodEnd": false
},
"planDetails": {
"id": "professional",
"name": "Professional",
"monthlyCredits": 3000,
"price": 12.99,
"features": [
"3,000 credits/month",
"Priority support",
"Advanced analytics"
]
}
}
{
"hasSubscription": false,
"subscription": null,
"planDetails": null
}
{
"hasSubscription": true,
"subscription": {
"plan": "professional",
"status": "active",
"billingCycle": "monthly",
"currentPeriodStart": "2024-01-15T00:00:00Z",
"currentPeriodEnd": "2024-02-15T00:00:00Z",
"cancelAtPeriodEnd": true
},
"planDetails": {
"id": "professional",
"name": "Professional",
"monthlyCredits": 3000,
"price": 12.99,
"features": [...]
}
}
レスポンスフィールド
boolean
ユーザーに有効な契約があるかどうか。
object
object
プランの全体情報(契約がない場合は
null)。契約ステータス
| ステータス | 説明 |
|---|---|
active | 契約が有効で正常です |
trialing | 無料試用期中です |
past_due | 支払い失敗があり、まもなく停止する可能性があります |
canceled | 契約は完全に解約されています |
エラーレスポンス
error
未認証 — トークンが無効または未指定です。
GET /subscriptions/current/api
API キー認証で現在の契約情報を返します。サードパーティ連携向けです。認証
API キー認証が必要です。Authorization ヘッダーに API キーを付与します。
Authorization: Bearer llmgen_your_api_key_here
レスポンス
/subscriptions/current と同一です。
curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current/api \
-H "Authorization: Bearer llmgen_your_api_key_here"
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/current/api', {
headers: {
'Authorization': 'Bearer llmgen_your_api_key_here'
}
});
const data = await response.json();
import requests
response = requests.get(
'https://api.llmgenerator.com/api/v1/subscriptions/current/api',
headers={'Authorization': 'Bearer llmgen_your_api_key_here'}
)
data = response.json()
このページは役に立ちましたか?
⌘I