AZComply Riferimento API
L'API AZComply offre accesso programmatico alla classificazione deterministica del Regolamento IA UE e alle valutazioni asincrone. Integra il rilevamento del rischio regolatorio direttamente nelle pipeline CI/CD, nei flussi di lavoro di conformità o nelle applicazioni aziendali.
Due livelli: POST /v1/classify esegue il motore deterministico senza crediti e senza LLM. POST /v1/assess esegue una valutazione narrativa asincrona per analisi, piani d'azione e rapporti pronti per PDF (1 credito per valutazione).
/v1/classify
Sincrono · Gratuito · Solo motore
/v1/assess
Asincrono · 1 credito · HTTP 202 · Pipeline completa
Chiavi API
az_live_* / az_test_* · SHA-256 archiviato
URL di base
Tutte le richieste devono utilizzare HTTPS. Le connessioni HTTP verranno rifiutate.
Gestione versioni
L'API è versionata tramite il percorso URL (/v1/). Le modifiche incompatibili verranno rilasciate con un nuovo prefisso di versione (ad es. /v2/) e un preavviso di deprecazione di 12 mesi. La versione del motore del Regolamento IA UE viene restituita in ogni risposta come engine_version.
Autenticazione
L'API AZComply utilizza chiavi API per l'autenticazione. Includi la tua chiave in ogni richiesta utilizzando l'header HTTP X-API-Key.
Tipi di chiave
| Prefisso | Tipo | Comportamento |
|---|---|---|
az_live_* | Produzione | Classificazione reale, consuma crediti su /v1/assess |
az_test_* | Sandbox | Nessun LLM, nessun credito. /v1/assess restituisce immediatamente un risultato mock deterministico |
Modalità sandbox
Utilizza le chiavi az_test_* nel tuo ambiente di sviluppo e CI/CD. Le chiamate a POST /v1/assess restituiscono immediatamente un risultato deterministico (nessun LLM, nessun job in background, nessun costo in crediti). Il flag sandbox: true è sempre impostato nelle risposte sandbox.
Avvio rapido
Effettua la tua prima chiamata API in meno di 2 minuti.
1. Crea una chiave
Accedi a Dashboard → Chiavi API e fai clic su Crea chiave. La chiave completa viene mostrata una sola volta — salvala nel tuo gestore di segreti (AWS Secrets Manager, GitHub Secrets, Vault, ecc.).
2. Effettua la prima chiamata
Classifica la descrizione di un sistema AI. Nessun credito consumato.
curl -X POST https://api.azcomply.eu/v1/classify \
-H "X-API-Key: az_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "AI system that automatically ranks job applicants by scoring their CVs before human review",
"jurisdictions": ["FR"]
}'3. Interpreta la risposta
{
"risk_code": "HIGH_RISK",
"ci_status": "block",
"gate_pass": false,
"verdict": {
"classification": "HIGH",
"obligations_count": 9,
"fine_exposure": "€15,000,000 or 3% of global annual turnover"
},
"compliance_deadline": "2027-12-02",
"engine_version": "current",
"classified_at": "2026-03-25T14:30:00Z"
}POST /v1/classify
/v1/classifyClassificazione deterministica · Nessun credito · JSON sincrono
Classifica un sistema AI rispetto al Regolamento IA UE 2024/1689 utilizzando il motore Python deterministico. Costo LLM zero. Restituisce livello di rischio, conteggio obblighi, requisito FRIA, esposizione alle sanzioni e scadenza di conformità in meno di 100 ms.
classify (incluso su tutte le chiavi per impostazione predefinita). Questo endpoint è gratuito — il motore è Python puro e non costa nulla da eseguire.Corpo della richiesta
Due modalità di input — fornisci description (testo libero) oppure facts (strutturato).
Modalità A — Testo libero
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
description | string | Obbligatorio | Plain-text description of the AI system (10–14,000 chars)e.g. "CV ranking AI used in HR" |
system_name | string | Facoltativo | Human-readable name for the systeme.g. "HireBot v2" |
jurisdictions | string[] | Facoltativo | ISO-2 country codes. Loads national law context.e.g. ["FR", "BE"] |
Modalità B — Fatti strutturati
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
facts | object | Obbligatorio | Pre-structured SystemFacts fields. Useful for CI/CD where you know the system properties.e.g. {"is_hr_tool": true, "operator_role": "DEPLOYER"} |
Risposta
curl -X POST https://api.azcomply.eu/v1/classify \
-H "X-API-Key: az_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "AI system that automatically ranks job applicants by scoring their CVs before human review",
"jurisdictions": ["FR"]
}'{
"risk_code": "HIGH_RISK",
"ci_status": "block",
"gate_pass": false,
"verdict": {
"classification": "HIGH",
"obligations_count": 9,
"fine_exposure": "€15,000,000 or 3% of global annual turnover"
},
"compliance_deadline": "2027-12-02",
"engine_version": "current",
"classified_at": "2026-03-25T14:30:00Z"
}Campi di risposta
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
risk_level | string | Obbligatorio | PROHIBITED | HIGH_RISK | LIMITED_RISK | MINIMAL_RISK | GPAI | GPAI_SYSTEMIC | UNCODED |
operator_role | string | Obbligatorio | PROVIDER | DEPLOYER | IMPORTER | DISTRIBUTOR |
annex_iii_category | string | null | Obbligatorio | Matched Annex III category if HIGH_RISK, e.g. "Employment & HR — Annex III §4(a)" |
obligations_count | integer | Obbligatorio | Number of EU AI Act obligations applicable to this system |
fria_required | boolean | Obbligatorio | Whether a Fundamental Rights Impact Assessment is required (Art. 27) |
national_law_flags | string[] | Obbligatorio | National law indicators detected, e.g. ["CAO_39_BE", "CNIL_FR"] |
compliance_deadline | string | null | Obbligatorio | ISO 8601 date of applicable compliance deadline |
fine_exposure | object | Obbligatorio | { max_tier: string, max_eur: integer } — maximum fine under EU AI Act |
gate_pass | boolean | Obbligatorio | Boolean CI/CD gate result. A false value blocks the response; review risk and obligations before deployment. |
engine_version | string | Obbligatorio | Classification engine version from /v1/systems/engine-info |
sandbox | boolean | Obbligatorio | True if request was made with an az_test_* key |
Modalità strutturata (CI/CD)
Trasmetti le proprietà del sistema pre-estratte come fatti strutturati per risultati deterministici nelle pipeline automatizzate:
curl -X POST https://api.azcomply.eu/v1/classify \
-H "X-API-Key: az_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"facts": {
"system_name": "CV Ranking Engine",
"system_description": "Scores and ranks job applicants",
"operator_role": "DEPLOYER",
"jurisdictions": ["FR"],
"is_hr_tool": true,
"employee_count": 250,
"uses_gpai_model": false
}
}'POST /v1/assess
/v1/assessValutazione narrativa · 1 credito · Async 202
Esegue la pipeline di valutazione completa: estrazione dei fatti, classificazione deterministica, 9 personas LLM (critico logico, consulente FRIA, architetto del piano d'azione, redattore del rapporto, ecc.) e restituisce un narrativo completo con piano d'azione. Restituisce immediatamente 202 Accepted con un job_id.
assess (non incluso per impostazione predefinita — abilitalo durante la creazione della chiave). Costo: 1 credito, detratto solo al termine della pipeline.Corpo della richiesta
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
description | string | Obbligatorio | Plain-text description of the AI system (20–14,000 chars) |
language | string | Facoltativo | Report language: en, fr, nl, de, it, es. Default: en |
jurisdictions | string[] | Facoltativo | ISO-2 country codes for national law context |
webhook_url | string | Facoltativo | HTTPS URL to receive classification.completed / classification.failed events |
webhook_secret | string | Facoltativo | Secret for HMAC-SHA256 signature verification |
curl -X POST https://api.azcomply.eu/v1/assess \
-H "X-API-Key: az_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Document describing our AI-powered credit scoring system...",
"language": "en",
"jurisdictions": ["BE"],
"webhook_url": "https://hooks.yourcompany.com/azcomply",
"webhook_secret": "your-webhook-secret"
}'{
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "queued",
"poll_url": "/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6",
"estimated_seconds": 60
}Polling del job
Interroga GET /v1/jobs/{job_id} ogni 5 secondi fino a quando lo stato è completed o failed. L'header Retry-After indica l'intervallo di polling consigliato.
# Poll for completion (every 5 seconds)
curl https://api.azcomply.eu/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "X-API-Key: az_live_YOUR_KEY"
# Fetch result once status == "completed"
curl https://api.azcomply.eu/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6/result \
-H "X-API-Key: az_live_YOUR_KEY"| Stato | Significato | Azione |
|---|---|---|
queued | Job ricevuto, in attesa di un worker | Attendi, interroga di nuovo |
processing | Pipeline in esecuzione (personas LLM attive) | Attendi, interroga di nuovo |
completed | Tutte le fasi completate, risultato disponibile | Recupera /result |
failed | Errore della pipeline — il campo error contiene i dettagli | Controlla l'errore e riprova |
Risultato
Quando status === completed, recupera il risultato completo:
/v1/jobs/{job_id}/resultRestituisce il report JSON completo quando il job è completato
{
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"risk_level": "HIGH_RISK",
"operator_role": "DEPLOYER",
"obligations_count": 11,
"fria_required": true,
"national_law_flags": ["CAO_39_BE", "CAO_9_BE"],
"compliance_deadline": "2027-12-02",
"fine_exposure": { "max_tier": "TIER_2_HIGH_RISK", "max_eur": 15000000 },
"gate_pass": false,
"validation_score": 94,
"fallacy_flags": [],
"bias_flags": [],
"fria_analysis": "A Fundamental Rights Impact Assessment is required under Art. 27...",
"action_plan": "Phase 1 (0–3 months): Establish AI governance framework...",
"narrative": "This credit scoring system presents significant regulatory risk...",
"completed_at": "2026-03-25T14:31:03Z"
}POST /v1/workpapers
/v1/workpapersWorkpaper Markdown a pagamento · 1 credito · Async 202 · Trasporto API/MCP
Genera un workpaper Markdown di qualità a pagamento per client API headless e agenti MCP. Usa lo stesso flusso di estrazione QAE ospitata, classificazione deterministica, prenotazione del credito, polling dei job e conservazione dei risultati del percorso di report API a pagamento, ma restituisce un risultato del job leggibile da macchina contenente markdown invece di un artefatto di report PDF.
assess. Costo: 1 credito, finalizzato solo al termine del workpaper. Usa Idempotency-Key nei nuovi tentativi per evitare prenotazioni duplicate.Corpo della richiesta
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
description | string | Obbligatorio | Plain-text description of the AI system (20-14,000 chars) |
system_name | string | Facoltativo | Display name used in the generated workpaper |
jurisdictions | string[] | Facoltativo | ISO-2 country codes for national law context |
brief_scope | auto | single | composite | portfolio | Facoltativo | Use composite for independently operable component suites |
components | object[] | Facoltativo | Component boundaries for composite-system workpapers |
include_coverage_overlay | boolean | Facoltativo | Adds deterministic coverage matrix rows |
curl -X POST https://api.azcomply.eu/v1/workpapers \
-H "X-API-Key: az_live_YOUR_KEY" \
-H "Idempotency-Key: hospital-suite-2026-05-30" \
-H "Content-Type: application/json" \
-d '{
"system_name": "Hospital Operations Suite",
"description": "Integrated hospital AI suite with triage, scheduling, diagnostics, kiosk, and facilities components...",
"jurisdictions": ["BE"],
"brief_scope": "composite",
"components": [
{ "name": "Patient Triage", "description": "Assigns urgency scores and appointment priority" }
]
}'{
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "queued",
"poll_url": "/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6",
"estimated_seconds": 60
}Risultato
Interroga GET /v1/jobs/{job_id}, quindi recupera GET /v1/jobs/{job_id}/result al termine. Il risultato include markdown, risk_level, surface e output_mode.
Webhook
Configura un URL webhook su POST /v1/assess per ricevere notifiche in tempo reale quando una valutazione viene completata o fallisce. AZComply firma ogni consegna con HMAC-SHA256 — verifica sempre la firma prima di elaborare.
Eventi
| Evento | Quando | campi dati |
|---|---|---|
classification.completed | Pipeline riuscita | job_id, risk_level, obligations_count, fria_required, compliance_deadline |
classification.failed | Pipeline non riuscita (credito rilasciato) | job_id, error |
Header in ogni consegna
Verifica firma
Verifica sempre l'header X-AZComply-Signature prima di elaborare i payload webhook.
import hmac, hashlib, json
def verify_azcomply_signature(
body: bytes,
signature_header: str,
secret: str,
) -> bool:
"""
Verify X-AZComply-Signature header on incoming webhook.
signature_header looks like: sha256=<hex_digest>
"""
expected = "sha256=" + hmac.new(
key=secret.encode(),
msg=body,
digestmod=hashlib.sha256,
).hexdigest()
return hmac.compare_digest(expected, signature_header)
# Flask example
from flask import Flask, request, abort
app = Flask(__name__)
WEBHOOK_SECRET = "your-webhook-secret"
@app.route("/webhook", methods=["POST"])
def handle_webhook():
sig = request.headers.get("X-AZComply-Signature", "")
if not verify_azcomply_signature(request.data, sig, WEBHOOK_SECRET):
abort(401)
payload = request.get_json()
event = payload["event"] # "classification.completed"
job_id = payload["data"]["job_id"]
risk_level = payload["data"]["risk_level"]
# ... handle event
return "", 200Logica di ripetizione
AZComply ritenta le consegne fallite fino a 3 volte con backoff esponenziale: 2 s → 4 s → 8 s. Dopo 3 tentativi falliti l'evento viene eliminato — verifica la disponibilità del tuo endpoint. Le risposte 4xx non vengono ritentate (trattale come errori permanenti dalla tua parte).
Gestione chiavi
Gestisci le chiavi API tramite l'API REST o la Dashboard. Gli endpoint di gestione delle chiavi utilizzano l'autenticazione JWT bearer (il tuo token di sessione utente) — non l'autenticazione tramite chiave API.
Crea chiave
/v1/keysAuth JWT · Crea chiave · Chiave grezza restituita UNA SOLA VOLTA
curl -X POST https://api.azcomply.eu/v1/keys \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD Pipeline",
"scopes": ["classify", "assess"],
"sandbox": false
}'
# Response (key shown ONCE — store it now):
{
"key_id": "...",
"raw_key": "az_live_FULL_KEY_SHOWN_ONCE_STORE_NOW",
"key_prefix": "az_live_abcd...",
"name": "CI/CD Pipeline",
"scopes": ["classify", "assess"],
"sandbox": false,
"created_at": "2026-03-25T14:00:00Z",
"warning": "Store this key securely. It will not be shown again."
}Elenca chiavi
/v1/keysAuth JWT · Restituisce tutte le chiavi del tuo account
curl https://api.azcomply.eu/v1/keys \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Revoca chiave
/v1/keys/{key_id}Auth JWT · Revoca immediata · Idempotente
curl -X DELETE https://api.azcomply.eu/v1/keys/KEY_ID \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Returns 204 No ContentErrori
| Codice | Nome | Significato |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created (POST /v1/keys) |
| 202 | Accepted | Job queued (POST /v1/assess) |
| 401 | Unauthorized | Missing, invalid, or revoked API key |
| 402 | Payment Required | Insufficient credits for /v1/assess |
| 403 | Forbidden | Key exists but lacks required scope |
| 404 | Not Found | Job ID not found or belongs to different key |
| 409 | Conflict | Job failed — error field contains details |
| 410 | Gone | Job expired (results retained 7 days) |
| 422 | Unprocessable | Validation error — missing required fields |
| 425 | Too Early | Job result not yet ready — retry after Retry-After seconds |
| 429 | Too Many Requests | Daily rate limit exceeded — see X-RateLimit-* headers |
| 500 | Server Error | Internal error — transient, retry with backoff |
Formato errore
Tutti gli errori restituiscono un corpo JSON con un campo detail:
// 401 Unauthorized
{
"detail": "Invalid or revoked API key."
}
// 402 Payment Required
{
"detail": "Insufficient credits. Purchase more at https://azcomply.eu/pricing"
}
// 422 Validation Error
{
"detail": "Provide either 'description' (free-text) or 'facts' (structured dict)."
}
// 429 Rate Limit
{
"detail": "Daily rate limit of 500 calls exceeded. Resets at midnight UTC.",
// Headers also set:
// Retry-After: 3600
// X-RateLimit-Limit: 500
// X-RateLimit-Remaining: 0
}Limiti di velocità
I limiti di velocità sono per chiave API e si azzerano ogni giorno alle 00:00 UTC. Il limite predefinito è di 500 chiamate/giorno. I contatori mensili si azzerano il 1° di ogni mese.
| Endpoint | Limite giornaliero predefinito | Note |
|---|---|---|
POST /v1/classify | 500 / key / day | Gratuito, solo motore. Nessun costo in crediti. |
POST /v1/assess | 500 / key / day | Anche limitato dai crediti. Si applica il limite più basso. |
GET /v1/jobs/* | 500 / key / day | Interroga a intervalli di ≤5 secondi. |
Header dei limiti di velocità
Ogni risposta include questi header:
Strategia di backoff
Se ricevi un 429, attendi il numero di secondi indicato nell'header Retry-After prima di riprovare.
import time, requests
def classify_with_backoff(description: str, api_key: str) -> dict:
for attempt in range(3):
r = requests.post(
"https://api.azcomply.eu/v1/classify",
headers={"X-API-Key": api_key},
json={"description": description},
)
if r.status_code == 429:
wait = int(r.headers.get("Retry-After", 60))
print(f"Rate limited. Retrying in {wait}s...")
time.sleep(wait)
continue
r.raise_for_status()
return r.json()
raise Exception("Rate limit exceeded after 3 attempts")Motore current · UE 2024/1689 · Residenza dati GDPR: europe-west4
© 2026 AZComply — Strumento di rilevamento, non consulenza legale.