Référence de l'API
Compte
Gérer ses clés API et lire sa consommation. Ces routes demandent une session du site, pas une clé API.
- DELETE
/v1/account - GET
/v1/account/keys - POST
/v1/account/keys - DELETE
/v1/account/keys/{keyId} - GET
/v1/account/usage
Delete my account
DELETE/v1/accountSession
Revokes all of the user's keys, then deletes the user from Supabase Auth. If Supabase fails (502 `account_delete_failed`) the keys stay revoked and the same request again completes the deletion. Keys and usage are kept, revoked, as billing history.
Demande la session du site (jeton Supabase), pas une clé API.
Erreurs
401No session, or an invalid or expired one (`invalid_session`)429Too many requests (`rate_limited`); see `Retry-After`502Keys revoked, but the user could not be deleted from Supabase (`account_delete_failed`)503Accounts are not enabled (`accounts_disabled`), account deletion is not (`account_delete_disabled`), or the session could not be checked (`unavailable`)
curl -X DELETE https://api.autopic.io/v1/account \
-H "Authorization: Bearer $SESSION_TOKEN"const res = await fetch('https://api.autopic.io/v1/account', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SESSION_TOKEN}` },
});
const data = await res.json();import os, requests
res = requests.delete(
"https://api.autopic.io/v1/account",
headers={"Authorization": f"Bearer {os.environ['SESSION_TOKEN']}"},
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/v1/account');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('SESSION_TOKEN')],
]);
$data = json_decode(curl_exec($ch), true);Lister ses clés API
GET/v1/account/keysSession
The signed-in user's keys, newest first, revoked ones included.
Demande la session du site (jeton Supabase), pas une clé API.
Réponse 200
keysobject[]obligatoireAfficher les 9 attributs
idstring (uuid)obligatoirenamestringobligatoireprefixstringobligatoireThe start of the key, to recognize it.
planstringobligatoireratePerMinuteintegerobligatoiremonthlyQuotainteger, nullobligatoireBillable units per calendar month; null for no cap.
createdAtstring (date-time)obligatoirerevokedAtstring (date-time), nullobligatoirelastUsedAtstring (date), nullobligatoireThe last UTC day the key made a request.
Erreurs
401No session, or an invalid or expired one (`invalid_session`)429Too many requests (`rate_limited`); see `Retry-After`503Accounts are not enabled on this server (`accounts_disabled`), or the session could not be checked (`unavailable`)
curl https://api.autopic.io/v1/account/keys \
-H "Authorization: Bearer $SESSION_TOKEN"const res = await fetch('https://api.autopic.io/v1/account/keys', {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.SESSION_TOKEN}` },
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.autopic.io/v1/account/keys",
headers={"Authorization": f"Bearer {os.environ['SESSION_TOKEN']}"},
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/v1/account/keys');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('SESSION_TOKEN')],
]);
$data = json_decode(curl_exec($ch), true);{
"keys": [
{
"id": "3f1c2a8e-6b7d-4e1a-9c0b-2d5e8f7a1b34",
"name": "Garage production",
"prefix": "apk_3f9c01ab",
"plan": "free",
"ratePerMinute": 60,
"monthlyQuota": 1000,
"createdAt": "2026-11-27T10:00:00Z",
"revokedAt": null,
"lastUsedAt": "2026-11-27"
}
]
}Créer une clé API
POST/v1/account/keysSession
Creates a free key (60 requests per minute, 1000 VINs per month). The response is the only time the secret is returned; only its hash is kept. At most five keys may be active at once.
Demande la session du site (jeton Supabase), pas une clé API.
Corps de la requête
namestringobligatoireTrimmed; 1 to 60 characters.
Exemple de corps
{
"name": "My garage app"
}Réponse 201
keyobjectobligatoireAfficher les 9 attributs
idstring (uuid)obligatoirenamestringobligatoireprefixstringobligatoireThe start of the key, to recognize it.
planstringobligatoireratePerMinuteintegerobligatoiremonthlyQuotainteger, nullobligatoireBillable units per calendar month; null for no cap.
createdAtstring (date-time)obligatoirerevokedAtstring (date-time), nullobligatoirelastUsedAtstring (date), nullobligatoireThe last UTC day the key made a request.
secretstringobligatoire
Erreurs
400Invalid request401No session, or an invalid or expired one (`invalid_session`)409Five keys are already active (`key_limit`)429Too many requests (`rate_limited`); see `Retry-After`503Accounts are not enabled on this server (`accounts_disabled`), or the session could not be checked (`unavailable`)
curl -X POST https://api.autopic.io/v1/account/keys \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"My garage app"}'const res = await fetch('https://api.autopic.io/v1/account/keys', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.SESSION_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "My garage app"
}),
});
const data = await res.json();import os, requests
res = requests.post(
"https://api.autopic.io/v1/account/keys",
headers={"Authorization": f"Bearer {os.environ['SESSION_TOKEN']}"},
json={"name":"My garage app"},
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/v1/account/keys');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('SESSION_TOKEN'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"My garage app"}',
]);
$data = json_decode(curl_exec($ch), true);{
"key": {
"id": "3f1c2a8e-6b7d-4e1a-9c0b-2d5e8f7a1b34",
"name": "Garage production",
"prefix": "apk_3f9c01ab",
"plan": "free",
"ratePerMinute": 60,
"monthlyQuota": 1000,
"createdAt": "2026-11-27T10:00:00Z",
"revokedAt": null,
"lastUsedAt": "2026-11-27"
},
"secret": "apk_3f9c…"
}Révoquer une clé API
DELETE/v1/account/keys/{keyId}Session
Revoking an already revoked key of one's own succeeds again. Another user's key answers 404, as an unknown one does.
Demande la session du site (jeton Supabase), pas une clé API.
Paramètres
keyIdstring (uuid) · cheminobligatoire
Erreurs
401No session, or an invalid or expired one (`invalid_session`)404Resource not found429Too many requests (`rate_limited`); see `Retry-After`503Accounts are not enabled on this server (`accounts_disabled`), or the session could not be checked (`unavailable`)
curl -X DELETE https://api.autopic.io/v1/account/keys/{keyId} \
-H "Authorization: Bearer $SESSION_TOKEN"const res = await fetch('https://api.autopic.io/v1/account/keys/{keyId}', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SESSION_TOKEN}` },
});
const data = await res.json();import os, requests
res = requests.delete(
"https://api.autopic.io/v1/account/keys/{keyId}",
headers={"Authorization": f"Bearer {os.environ['SESSION_TOKEN']}"},
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/v1/account/keys/{keyId}');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('SESSION_TOKEN')],
]);
$data = json_decode(curl_exec($ch), true);Lire sa consommation
GET/v1/account/usageSession
Requests and billable units (one per VIN decoded) across the user's keys, per UTC day, route and key. Counts can lag by up to 30 seconds when the API runs on several instances.
Demande la session du site (jeton Supabase), pas une clé API.
Paramètres
fromstring (date) · requêteFirst day, UTC. Defaults to the first day of the current month.
tostring (date) · requêteLast day, UTC, included. Defaults to today. At most 366 days after `from`, counting both.
Réponse 200
fromstring (date)obligatoiretostring (date)obligatoiremonthobjectobligatoireThe current UTC month, whatever the range.
Afficher les 2 attributs
unitsintegerobligatoireBillable units across all the user's keys.
quotainteger, nullobligatoireThe sum of the active keys' monthly quotas; null when one has no cap. Each key's quota is enforced on its own.
daysobject[]obligatoireEvery day of the range, in order, zeros included.
Afficher les 3 attributs
daystring (date)obligatoirerequestsintegerobligatoireunitsintegerobligatoire
routesobject[]obligatoireRoutes used in the range, most units first.
Afficher les 3 attributs
routestringobligatoirerequestsintegerobligatoireunitsintegerobligatoire
keysobject[]obligatoireEvery active key, and revoked keys used in the range, most units first.
Afficher les 4 attributs
keyIdstring (uuid)obligatoirenamestringobligatoirerequestsintegerobligatoireunitsintegerobligatoire
Erreurs
400Invalid request401No session, or an invalid or expired one (`invalid_session`)429Too many requests (`rate_limited`); see `Retry-After`503Accounts are not enabled on this server (`accounts_disabled`), or the session could not be checked (`unavailable`)
curl https://api.autopic.io/v1/account/usage \
-H "Authorization: Bearer $SESSION_TOKEN"const res = await fetch('https://api.autopic.io/v1/account/usage', {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.SESSION_TOKEN}` },
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.autopic.io/v1/account/usage",
headers={"Authorization": f"Bearer {os.environ['SESSION_TOKEN']}"},
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/v1/account/usage');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('SESSION_TOKEN')],
]);
$data = json_decode(curl_exec($ch), true);{
"from": "2026-11-27",
"to": "2026-11-27",
"month": {
"units": 0,
"quota": 0
},
"days": [
{
"day": "2026-11-27",
"requests": 0,
"units": 0
}
],
"routes": [
{
"route": "POST /v1/vin/decode",
"requests": 0,
"units": 0
}
],
"keys": [
{
"keyId": "3f1c2a8e-6b7d-4e1a-9c0b-2d5e8f7a1b34",
"name": "Garage production",
"requests": 0,
"units": 0
}
]
}