Schéma JSON : extraire une facture
JSON Schema pour extraire une facture avec un LLM : fournisseur, numéro, date, lignes, totaux HT, TVA et TTC. Prêt pour les sorties structurées.
Extrais les informations de la facture fournie. Les montants sont des nombres en euros, sans symbole. Si une information manque, ne l'invente pas.
JSON Schema
{
"type": "object",
"required": [
"fournisseur",
"date",
"total_ttc"
],
"properties": {
"tva": {
"type": "number"
},
"date": {
"type": "string",
"format": "date",
"description": "Date d'émission (AAAA-MM-JJ)"
},
"lignes": {
"type": "array",
"items": {
"type": "object",
"required": [
"libelle",
"montant_ht"
],
"properties": {
"libelle": {
"type": "string"
},
"quantite": {
"type": "number"
},
"montant_ht": {
"type": "number"
}
}
}
},
"numero": {
"type": "string",
"description": "Numéro de la facture"
},
"total_ht": {
"type": "number"
},
"total_ttc": {
"type": "number"
},
"fournisseur": {
"type": "string",
"description": "Raison sociale du fournisseur"
}
}
}Beispielausgabe
{
"fournisseur": "Imprimerie Martin SARL",
"numero": "F-2026-0412",
"date": "2026-09-15",
"lignes": [
{
"libelle": "Cartes de visite x500",
"quantite": 1,
"montant_ht": 80.0
},
{
"libelle": "Flyers A5 x1000",
"quantite": 1,
"montant_ht": 120.0
}
],
"total_ht": 200.0,
"tva": 40.0,
"total_ttc": 240.0
}Geschätzte Kosten
Eingabe-Tokens pro Aufruf : ≈ 539
| Modell | Pro Aufruf | Pro 1.000 Aufrufe |
|---|---|---|
| Mistral Large · Mistral AI | 0,00024 € | 0,24 € |
| DeepSeek Flash · DeepSeek | 0,00014 € | 0,14 € |
| DeepSeek V4 Pro · DeepSeek | 0,00063 € | 0,63 € |
| GPT-6 Luna · OpenAI | 0,00005 € | 0,05 € |
| GPT-6 Sol · OpenAI | 0,00095 € | 0,95 € |
| Claude Sonnet 5.5 · Anthropic | 0,00095 € | 0,95 € |
| Claude Opus 5.5 · Anthropic | 0,00190 € | 1,90 € |
| Selbst gehostetes Open-Source-Modell (Ollama, vLLM) | 0 € API-Kosten (nur Serverkosten) | |
Nur Eingabekosten, ohne die Antwort des Modells. Öffentliche Standardpreise der Anbieter (Mistral AI, DeepSeek, OpenAI, Anthropic) von USD in Euro umgerechnet zum EZB-Kurs vom 29. September 2026. Schätzung: 1 Token ≈ 3,6 Zeichen.
Common to all 3 regions
Created by the author, no outside source.
Commercial use allowed · credit the author · changes allowed.
Text or data only: no access to files, network or commands.
Hosted in France (Scaleway, Paris). No transfer outside the EU.
European Union · 5/5
No personal data.
No training data: no summary required.
United States · 5/5
No personal data.
No training data: no documentation to publish.
China · 5/5
No personal data.
No training data; AI-generated content published in China must be labelled (2025).
Indicative summary as of 30/09/2026, not a legal certification. Method and sources →
Statistiken
Gefällt mir : 0 · Kommentare : 0
Klicken Sie auf einen Zähler, um ihn ein- oder auszublenden; fahren Sie über das Diagramm für Details. Ein Aufruf pro Besucher und Tag, ohne Bots; Zählung seit dem 30. September 2026.
- Kennung
- contextetech--extraire-une-facture
- Typ
- Ausgabeschemas
- Datei
- extraire-une-facture.schema.json
- Format
- JSON (application/json)
- Größe
- 977 Bytes
- Kodierung
- UTF-8
- Geschätzte Tokens
- ≈ 271
- Sprache
- Französisch
- Lizenz
- MIT
- Kommerzielle Nutzung
- Erlaubt
- Personenbezogene Daten
- Keine
- Version
- 1.0
- Veröffentlicht am
- 1. Oktober 2026 um 18:46
- Aktualisiert am
- 1. Oktober 2026 um 18:46
- Speicherung
- in der Datenbank
- Nutzungen
- 0
- Gefällt mir
- 0
extraire-une-facture.schema.json
{
"type": "object",
"required": [
"fournisseur",
"date",
"total_ttc"
],
"properties": {
"tva": {
"type": "number"
},
"date": {
"type": "string",
"format": "date",
"description": "Date d'émission (AAAA-MM-JJ)"
},
"lignes": {
"type": "array",
"items": {
"type": "object",
"required": [
"libelle",
"montant_ht"
],
"properties": {
"libelle": {
"type": "string"
},
"quantite": {
"type": "number"
},
"montant_ht": {
"type": "number"
}
}
}
},
"numero": {
"type": "string",
"description": "Numéro de la facture"
},
"total_ht": {
"type": "number"
},
"total_ttc": {
"type": "number"
},
"fournisseur": {
"type": "string",
"description": "Raison sociale du fournisseur"
}
}
}Anthropic-API (Python)
import json, anthropic
schema = json.load(open("extraire-une-facture.schema.json"))
client = anthropic.Anthropic()
resp = client.messages.create(model="claude-sonnet-5", max_tokens=1024,
tools=[{"name": "extraire", "description": "Renvoie les données extraites", "input_schema": schema}],
tool_choice={"type": "tool", "name": "extraire"},
messages=[{"role": "user", "content": "deine Eingabe hier"}])
print(resp.content[0].input)OpenAI-Format (response_format)
{
"type": "json_schema",
"json_schema": {
"name": "extraire-une-facture",
"schema": {
"type": "object",
"required": [
"fournisseur",
"date",
"total_ttc"
],
"properties": {
"tva": {
"type": "number"
},
"date": {
"type": "string",
"format": "date",
"description": "Date d'émission (AAAA-MM-JJ)"
},
"lignes": {
"type": "array",
"items": {
"type": "object",
"required": [
"libelle",
"montant_ht"
],
"properties": {
"libelle": {
"type": "string"
},
"quantite": {
"type": "number"
},
"montant_ht": {
"type": "number"
}
}
}
},
"numero": {
"type": "string",
"description": "Numéro de la facture"
},
"total_ht": {
"type": "number"
},
"total_ttc": {
"type": "number"
},
"fournisseur": {
"type": "string",
"description": "Raison sociale du fournisseur"
}
}
},
"strict": true
}
}
Community
Noch keine Kommentare. Teile deine Erfahrung, sie hilft den Nächsten.