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 访问令牌。**第三方集成:**请改用
GET /subscriptions/current/api 并以 API Key 鉴权。认证
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 Key 返回当前订阅信息,适合第三方集成。认证
需要 API Key,在Authorization 请求头中携带:
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