API reference
Account
Manage your API keys and read your usage. These endpoints take a dashboard session, not an API key.
- 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.
Requires a dashboard session (Supabase token), not an API key.
Errors
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);List API keys
GET/v1/account/keysSession
The signed-in user's keys, newest first, revoked ones included.
Requires a dashboard session (Supabase token), not an API key.
Response 200
keysobject[]requiredShow 9 attributes
idstring (uuid)requirednamestringrequiredprefixstringrequiredThe start of the key, to recognize it.
planstringrequiredratePerMinuteintegerrequiredmonthlyQuotainteger, nullrequiredBillable units per calendar month; null for no cap.
createdAtstring (date-time)requiredrevokedAtstring (date-time), nullrequiredlastUsedAtstring (date), nullrequiredThe last UTC day the key made a request.
Errors
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"
}
]
}Create an API key
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.
Requires a dashboard session (Supabase token), not an API key.
Request body
namestringrequiredTrimmed; 1 to 60 characters.
Example body
{
"name": "My garage app"
}Response 201
keyobjectrequiredShow 9 attributes
idstring (uuid)requirednamestringrequiredprefixstringrequiredThe start of the key, to recognize it.
planstringrequiredratePerMinuteintegerrequiredmonthlyQuotainteger, nullrequiredBillable units per calendar month; null for no cap.
createdAtstring (date-time)requiredrevokedAtstring (date-time), nullrequiredlastUsedAtstring (date), nullrequiredThe last UTC day the key made a request.
secretstringrequired
Errors
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…"
}Revoke an API key
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.
Requires a dashboard session (Supabase token), not an API key.
Parameters
keyIdstring (uuid) · pathrequired
Errors
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);Retrieve usage
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.
Requires a dashboard session (Supabase token), not an API key.
Parameters
fromstring (date) · queryFirst day, UTC. Defaults to the first day of the current month.
tostring (date) · queryLast day, UTC, included. Defaults to today. At most 366 days after `from`, counting both.
Response 200
fromstring (date)requiredtostring (date)requiredmonthobjectrequiredThe current UTC month, whatever the range.
Show 2 attributes
unitsintegerrequiredBillable units across all the user's keys.
quotainteger, nullrequiredThe sum of the active keys' monthly quotas; null when one has no cap. Each key's quota is enforced on its own.
daysobject[]requiredEvery day of the range, in order, zeros included.
Show 3 attributes
daystring (date)requiredrequestsintegerrequiredunitsintegerrequired
routesobject[]requiredRoutes used in the range, most units first.
Show 3 attributes
routestringrequiredrequestsintegerrequiredunitsintegerrequired
keysobject[]requiredEvery active key, and revoked keys used in the range, most units first.
Show 4 attributes
keyIdstring (uuid)requirednamestringrequiredrequestsintegerrequiredunitsintegerrequired
Errors
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
}
]
}