Skip to main content
AZComply Riferimento API
v1Ultimo aggiornamento 2026-03-25

AZComply Riferimento API

L'API AZComply ti offre accesso programmatico al solo motore di classificazione deterministico del Regolamento IA UE al mondo. Incorpora il rilevamento del rischio regolatorio direttamente nelle tue pipeline CI/CD, nei flussi di lavoro di conformità o nelle applicazioni aziendali.

Due livelli: POST /v1/classify esegue il motore Python puro in <100 ms senza crediti e senza LLM. POST /v1/assess esegue la pipeline LLM completa a 9 personas in modo asincrono per analisi narrative, piani d'azione e rapporti pronti per PDF (1 credito per valutazione).

/v1/classify

Sincrono · Gratuito · <100 ms · Solo motore

🔬

/v1/assess

Asincrono · 1 credito · ~60 s · Pipeline completa

🔑

Chiavi API

az_live_* / az_test_* · SHA-256 archiviato

URL di base

https://api.azcomply.eu/v1

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.

X-API-Key: az_live_YOUR_SECRET_KEY
⚠️
Tieni segreta la tua chiave API. Non esporla mai in codice lato client, repository pubbliche o log. In caso di compromissione, revocala immediatamente dalla Dashboard → Chiavi API.

Tipi di chiave

PrefissoTipoComportamento
az_live_*ProduzioneClassificazione reale, consuma crediti su /v1/assess
az_test_*SandboxNessun 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

Risposta · JSON
{
  "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"
}
gate_pass: false indica che il sistema ha obblighi non soddisfattiusa obligations_count e fine_exposure per dare priorità agli interventi correttivi. Esegui POST /v1/assess per il narrativo completo del piano d'azione.

POST /v1/classify

POST
/v1/classify

Classificazione deterministica · Nessun credito · <100 ms

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.

💡
Ambito richiesto: 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

ParametroTipoObbligatorioDescrizione
descriptionstringObbligatorioPlain-text description of the AI system (10–14,000 chars)e.g. "CV ranking AI used in HR"
system_namestringFacoltativoHuman-readable name for the systeme.g. "HireBot v2"
jurisdictionsstring[]FacoltativoISO-2 country codes. Loads national law context.e.g. ["FR", "BE"]

Modalità B — Fatti strutturati

ParametroTipoObbligatorioDescrizione
factsobjectObbligatorioPre-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"]
  }'
Risposta · JSON
{
  "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

ParametroTipoObbligatorioDescrizione
risk_levelstringObbligatorioPROHIBITED | HIGH_RISK | LIMITED_RISK | MINIMAL_RISK | GPAI | GPAI_SYSTEMIC | UNCODED
operator_rolestringObbligatorioPROVIDER | DEPLOYER | IMPORTER | DISTRIBUTOR
annex_iii_categorystring | nullObbligatorioMatched Annex III category if HIGH_RISK, e.g. "Employment & HR — Annex III §4(a)"
obligations_countintegerObbligatorioNumber of EU AI Act obligations applicable to this system
fria_requiredbooleanObbligatorioWhether a Fundamental Rights Impact Assessment is required (Art. 27)
national_law_flagsstring[]ObbligatorioNational law indicators detected, e.g. ["CAO_39_BE", "CNIL_FR"]
compliance_deadlinestring | nullObbligatorioISO 8601 date of applicable compliance deadline
fine_exposureobjectObbligatorio{ max_tier: string, max_eur: integer } — maximum fine under EU AI Act
gate_passbooleanObbligatorioTrue only if no obligations detected (MINIMAL_RISK with no flags)
engine_versionstringObbligatorioClassification engine version from /v1/systems/engine-info
sandboxbooleanObbligatorioTrue 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

POST
/v1/assess

Pipeline LLM completa a 9 personas · 1 credito · ~60 s · 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.

💡
Ambito richiesto: assess (non incluso per impostazione predefinita — abilitalo durante la creazione della chiave). Costo: 1 credito, detratto solo al termine della pipeline.

Corpo della richiesta

ParametroTipoObbligatorioDescrizione
descriptionstringObbligatorioPlain-text description of the AI system (20–14,000 chars)
languagestringFacoltativoReport language: en, fr, nl, de, it, es. Default: en
jurisdictionsstring[]FacoltativoISO-2 country codes for national law context
webhook_urlstringFacoltativoHTTPS URL to receive classification.completed / classification.failed events
webhook_secretstringFacoltativoSecret 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"
  }'
Risposta · JSON
{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "queued",
  "poll_url": "/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "estimated_seconds": 60
}

Polling del job

docs.assess.pollingDesc 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"
StatoSignificatoAzione
queuedJob ricevuto, in attesa di un workerAttendi, interroga di nuovo
processingPipeline in esecuzione (personas LLM attive)Attendi, interroga di nuovo
completedTutte le fasi completate, risultato disponibileRecupera /result
failedErrore della pipeline — il campo error contiene i dettagliControlla l'errore e riprova

Risultato

Quando status === completed, recupera il risultato completo:

GET
/v1/jobs/{job_id}/result

Restituisce il report JSON completo quando il job è completato

Risposta · JSON
{
  "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

POST
/v1/workpapers

Workpaper 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.

💡
Ambito richiesto: assess. Costo: 1 credito, finalizzato solo al termine del workpaper. Usa Idempotency-Key nei nuovi tentativi per evitare prenotazioni duplicate.

Corpo della richiesta

ParametroTipoObbligatorioDescrizione
descriptionstringObbligatorioPlain-text description of the AI system (20-14,000 chars)
system_namestringFacoltativoDisplay name used in the generated workpaper
jurisdictionsstring[]FacoltativoISO-2 country codes for national law context
brief_scopeauto | single | composite | portfolioFacoltativoUse composite for independently operable component suites
componentsobject[]FacoltativoComponent boundaries for composite-system workpapers
include_coverage_overlaybooleanFacoltativoAdds 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" }
    ]
  }'
Risposta · JSON
{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "queued",
  "poll_url": "/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "estimated_seconds": 60
}

Risultato

docs.workpapers.resultDesc

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

EventoQuandocampi dati
classification.completedPipeline riuscitajob_id, risk_level, obligations_count, fria_required, compliance_deadline
classification.failedPipeline non riuscita (credito rilasciato)job_id, error

Header in ogni consegna

X-AZComply-Signature: sha256=<HMAC-SHA256(body, secret)>
X-AZComply-Event: classification.completed
X-AZComply-Timestamp: 1711365000
Content-Type: application/json

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 "", 200

Logica 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).

⚠️
Il tuo endpoint deve rispondere entro 10 secondi. Restituisci subito 200 ed elabora il payload in modo asincrono — non eseguire mai operazioni lente in modo sincrono nel gestore webhook.

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

POST
/v1/keys

Auth JWT · Crea chiave · Chiave grezza restituita UNA SOLA VOLTA

⚠️
La chiave grezza viene restituita una sola volta nella risposta di creazione e non viene mai memorizzata. Salvala immediatamente in un gestore di segreti — non può essere recuperata di nuovo.
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

GET
/v1/keys

Auth JWT · Restituisce tutte le chiavi del tuo account

curl https://api.azcomply.eu/v1/keys \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Revoca chiave

DELETE
/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 Content

Errori

CodiceNomeSignificato
200OKRequest succeeded
201CreatedResource created (POST /v1/keys)
202AcceptedJob queued (POST /v1/assess)
401UnauthorizedMissing, invalid, or revoked API key
402Payment RequiredInsufficient credits for /v1/assess
403ForbiddenKey exists but lacks required scope
404Not FoundJob ID not found or belongs to different key
409ConflictJob failed — error field contains details
410GoneJob expired (results retained 7 days)
422UnprocessableValidation error — missing required fields
425Too EarlyJob result not yet ready — retry after Retry-After seconds
429Too Many RequestsDaily rate limit exceeded — see X-RateLimit-* headers
500Server ErrorInternal error — transient, retry with backoff

Formato errore

Tutti gli errori restituiscono un corpo JSON con un campo detail:

Risposta · JSON
// 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.

EndpointLimite giornaliero predefinitoNote
POST /v1/classify500 / key / dayGratuito, solo motore. Nessun costo in crediti.
POST /v1/assess500 / key / dayAnche limitato dai crediti. Si applica il limite più basso.
GET /v1/jobs/*500 / key / dayInterroga a intervalli di ≤5 secondi.

Header dei limiti di velocità

Ogni risposta include questi header:

X-RateLimit-Limit: 500
X-RateLimit-Remaining: 342
Retry-After: 3600 # only on 429

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.

API Reference - AZComply