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": [...]
}
}
Abonnements
Abonnement en cours
Renvoie l’état et les détails de l’abonnement de l’utilisateur authentifié.
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": [...]
}
}
Vue d’ensemble
Renvoie les informations sur l’abonnement en cours : formule, cycle de facturation et dates de renouvellement. Nécessite une authentification par session (jeton d’accès JWT).Pour les intégrations tierces : utilisez
GET /subscriptions/current/api avec authentification par clé d’API.Authentification
string
requis
Jeton d’accès JWT. Format :
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": [...]
}
}
Champs de réponse
boolean
Indique si l’utilisateur dispose d’un abonnement actif.
object
Détails de l’abonnement (
null en l’absence d’abonnement).Afficher Propriétés
Afficher Propriétés
string
Identifiant de la formule (starter, professional, business, agency).
string
État actuel :
active, canceled, past_due ou trialing.string
Fréquence de facturation :
monthly ou yearly.string
Début de la période de facturation en cours (ISO 8601).
string
Fin de la période de facturation en cours (ISO 8601).
boolean
Si
true, l’abonnement prendra fin à currentPeriodEnd.object
Informations complètes sur la formule (
null en l’absence d’abonnement).États d’abonnement
| Statut | Description |
|---|---|
active | Abonnement actif et à jour |
trialing | Période d’essai en cours |
past_due | Échec de paiement, suspension possible |
canceled | Abonnement entièrement résilié |
Réponses d’erreur
error
Non autorisé : jeton manquant ou invalide.
GET /subscriptions/current/api
Renvoie les informations d’abonnement avec authentification par clé d’API. Adapté aux intégrations tierces.Authentification
Authentification par clé d’API obligatoire. Indiquez votre clé dans l’en-têteAuthorization :
Authorization: Bearer llmgen_your_api_key_here
Réponse
Identique à/subscriptions/current ci-dessus.
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()
Cette page vous a-t-elle été utile ?
⌘I