Den vollständigen Index der Dokumentation findest du in llms.txt. Die Markdown-Version einer Dokumentationsseite erhältst du, indem du
.md an die URL der Seite anhängst.
So kann dein Modell zuverlässige Quellenangaben erstellen.
Zuverlässige Quellenangaben schaffen Vertrauen. Wer eine Antwort liest, kann anhand der Quellen prüfen, ob die Aussagen stimmen. Dieser Leitfaden zeigt dir, wie du zitierfähiges Material aufbereitest und dem Modell vorgibst, wie es Quellen angeben soll. Die Beispiele verwenden Formate, mit denen die Modelle von OpenAI vertraut sind.
Überblick
Wenn du ein System für Quellenangaben entwickelst, legst du fest, was das Modell zitieren darf. Du bereitest das Material übersichtlich auf, gibst dem Modell Anweisungen zum Zitieren und prüfst das Ergebnis, bevor dein System es anzeigt.
Dieser Leitfaden behandelt fünf Aspekte, die unmittelbar mit der Arbeit des Modells zusammenhängen:
Zitierfähige Einheiten: Lege fest, worauf das Modell verweisen darf.
Darstellung des Materials: Stelle das Quellenmaterial in einem übersichtlichen, strukturierten Format bereit.
Format der Quellenangaben: Gib genau vor, in welchem Format das Modell Quellen angeben soll.
Anweisungen im Prompt: Erkläre dem Modell, wann und wie es Quellen korrekt angeben soll.
Auswertung der Quellenangaben: Extrahiere die Quellenangaben aus der Modellantwort, um sie weiterzuverarbeiten.
Zitierfähige Einheiten auswählen
Lege vor dem Schreiben deiner Prompts genau fest, was das Modell zitieren darf. Gängige Möglichkeiten sind:
Zitierfähige Einheit
Geeignet, wenn …
Nachteil
Beispiel
Dokument
du nur zeigen möchtest, aus welchem Dokument die Antwort stammt.
Die Angabe ist recht ungenau.
Verweise auf das gesamte Personalhandbuch, wenn es genügt, das Dokument zu nennen, das die Aussage belegt.
Block oder Textabschnitt
du ein ausgewogenes Verhältnis zwischen Einfachheit und Genauigkeit suchst.
Die Angabe ist noch nicht zeilengenau.
Verweise auf den Vertragsabsatz oder den abgerufenen Textabschnitt, in dem die Klausel steht.
Zeilenbereich
du die genaue Belegstelle zeigen musst.
Für das Modell ist diese Angabe schwieriger.
Verweise auf die Zeilen L42-L47, wenn jemand die genaue Textstelle prüfen muss.
Eine gute zitierfähige Einheit erfüllt folgende Kriterien:
Einheitliche Kennung: Dieselbe Quelle sollte bei jedem Durchlauf dieselbe ID behalten.
Leicht überprüfbar: Wer die Textstelle liest, sollte auch den Zusammenhang verstehen können.
Passende Größe: Die Einheit sollte groß genug sein, um für sich verständlich zu sein, und klein genug, um eine Aussage präzise zu belegen.
Für die meisten Systeme sind Quellenangaben auf Blockebene die beste Standardeinstellung. Sie sind für das Modell meist einfacher als zeilengenaue Angaben und für die Lesenden hilfreicher als ein Verweis auf das gesamte Dokument.
Zitierfähiges Material aufbereiten
Das Modell kann nur Material zitieren, das du ihm in verständlicher Form bereitstellst. Ob das Material von einem Tool stammt oder direkt in den Prompt eingefügt wird, achte auf Folgendes:
Stabile Quellen-ID: Verwende eine einheitliche Kennung wie file1 oder block1.
Gut lesbarer Text: Formatiere das Quellenmaterial übersichtlich.
Metadaten (optional): Ergänze URLs, Zeitstempel, Titel oder ähnliche Angaben zum Kontext.
Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}file0{CITATION_STOP}Title: Employee HandbookURL: https://company.example/handbookUpdated: 2026-03-01[L1] Employees may work remotely up to three days per week.[L2] Additional remote days require manager approval.[L3] Exceptions may apply for approved accommodations.
Quellen-ID und Fundstelle: Eine Quellen-ID ist eine stabile Kennung, die das Modell erzeugt, etwa block1. Die Fundstellenangabe bezeichnet die genaue Textstelle, die in der Benutzeroberfläche hervorgehoben wird, etwa lines L8-L13 oder
Paragraph 21. In der Regel sollte das Modell die Quellen-ID ausgeben. Dein System ermittelt die zugehörige Fundstelle oder zeigt sie an. Wenn du beides zu früh vermischst, treten häufiger Formatierungsfehler auf.
Format für Quellenangaben festlegen
Lege fest, in welchem Format das Modell Quellenangaben ausgeben soll. Wähle ein eindeutiges, einheitliches Format, das das Modell zuverlässig wiedergeben kann.
Die Tabelle zeigt das empfohlene Format und die zugehörigen Marker. Wir empfehlen diese Marker ausdrücklich, weil sie den Markern aus dem Training unserer Modelle sehr ähnlich sind. Wenn du andere Werte für die Marker wählst, behalte den Aufbau der Quellenangabe möglichst genau bei.
Bestandteil
Funktion
Empfehlung
CITATION_START
Kennzeichnet den Anfang des Quellenmarkers.
\ue200
Art der Quellenangabe
Gibt den Typ der Quellenangabe an. Verwende cite für alle unterstützten Quellen.
cite
CITATION_DELIMITER
Trennt die Felder innerhalb des Markers.
\ue202
Quellen-ID
Bezeichnet die zitierte Einheit. turn# steht für die Nummer des Aufrufs. item# bezeichnet die jeweilige Datei, den Block oder die URL.
turn0file1, turn0block1, turn0url1
Fundstellenangabe (optional)
Grenzt den Verweis auf eine genaue Textstelle ein.
L8-L13
CITATION_STOP
Kennzeichnet das Ende des Quellenmarkers.
\ue201
Bei Tool-Aufrufen erhöht sich turnN einmal pro Aufruf, unabhängig von der Anzahl der Ergebnisse. Innerhalb eines Aufrufs unterscheiden sich die Quellen durch Suffixe wie file0, file1 usw. In einem System, das eine einzelne Antwort erzeugt, beginnen alle Verweise nur dann mit
turn0…, wenn das Modell vor der Antwort genau einen Tool-Aufruf ausführt. Bei mehreren Aufrufen können Verweise wie turn0fileX, turn1fileX usw. auftreten.
Verwende vertraute Formate für Quellenangaben, damit das Modell möglichst genau arbeitet. Eigene oder ungewohnte Formate verlangen dem Modell mehr ab und führen leichter zu Fehlern, insbesondere in folgenden Fällen:
Bei geringem Reasoning-Aufwand hat das Modell weniger Spielraum, um Formatierungsfehler zu korrigieren.
Bei komplexen Aufgaben benötigt das Modell den Großteil seines Reasoning-Budgets für die eigentliche Lösung. Für die Korrektur der Syntax von Quellenangaben bleibt wenig übrig.
Das folgende empfohlene Format orientiert sich an Mustern, mit denen das Modell vertraut ist. Du kannst es direkt übernehmen oder an dein System anpassen.
Wenn du einen eigenen Prompt schreibst, lege Folgendes fest:
die genaue Syntax der Marker,
die Position der Quellenangaben im Text,
wann das Modell Quellen angeben und wann es darauf verzichten soll,
wie es mehrere Belege für eine Aussage angeben soll,
welche Formate unzulässig sind,
wie es vorgehen soll, wenn ein Beleg fehlt.
Gib dem Modell klare Anweisungen nach folgendem Muster:
## CitationsResults are returned by "tool_1". Each message from `tool_1` is called a "source" and identified by its reference ID, which is the first occurrence of 【turn\d+\w+\d+】 (e.g. 【turn2file1】). In this example, the string "turn2file1" would be the source reference ID.Citations are references to `tool_1` sources. Citations may be used to refer to either a single source or multiple sources.Citations to a single source must be written as {CITATION_START}cite{CITATION_DELIMITER}turn\d+\w+\d+{CITATION_STOP} (e.g. {CITATION_START}cite{CITATION_DELIMITER}turn2file5{CITATION_STOP}).Citations to multiple sources must be written as {CITATION_START}cite{CITATION_DELIMITER}turn\d+\w+\d+{CITATION_DELIMITER}turn\d+\w+\d+{CITATION_DELIMITER}...{CITATION_STOP} (e.g. {CITATION_START}cite{CITATION_DELIMITER}turn2file5{CITATION_DELIMITER}turn2file1{CITATION_DELIMITER}...{CITATION_STOP}).Citations must not be placed inside markdown bold, italics, or code fences, as they will not display correctly. Instead, place the citations outside the markdown block. Citations outside code fences may not be placed on the same line as the end of the code fence.You must NOT write reference ID turn\d+\w+\d+ verbatim in the response text without putting them between {CITATION_START}...{CITATION_STOP}.- Place citations at the end of the paragraph, or inline if the paragraph is long, unless the user requests specific citation placement.- Citations must be placed after punctuation.- Citations must not be all grouped together at the end of the response.- Citations must not be put in a line or paragraph with nothing else but the citations themselves.
Wenn das Modell auch Fundstellen wie Zeilenbereiche (L1-L22) ausgeben soll, gib das im Prompt so an:
You *must* cite any results you use from this tool using the:`\ue200cite\ue202turn0file0\ue202L8-L13\ue201` format ONLY if the item has a corresponding citation marker.
Zitiere keine Einträge ohne zugehörigen Quellenmarker. Sie sind nicht zum Zitieren vorgesehen.
Du MUSST in deinen Quellenangaben die Zeilenbereiche angeben.
Wenn du eine bessere Verankerung der Antworten in den Quellen brauchst, lohnt es sich oft, die folgenden Regeln aufzunehmen. Passe sie an die Anforderungen deines Anwendungsfalls an.
12345678910111213<extra_considerations_for_citations>- **Relevance:** Include only search results and citations that support the cited response text. Irrelevant sources permanently degrade user trust.- **Diversity:** You must base your answer on sources from diverse domains, and cite accordingly.- **Trustworthiness:** To produce a credible response, you must rely on high quality domains, and ignore information from less reputable domains unless they are the only source.- **Accurate Representation:** Each citation must accurately reflect the source content. Selective interpretation of the source content is not allowed.Remember, the quality of a domain/source depends on the context.- When multiple viewpoints exist, cite sources covering the spectrum of opinions to ensure balance and comprehensiveness.- When reliable sources disagree, cite at least one high-quality source for each major viewpoint.- Ensure more than half of citations come from widely recognized authoritative outlets on the topic.- For debated topics, cite at least one reliable source representing each major viewpoint.- Do not ignore the content of a relevant source because it is low quality.</extra_considerations_for_citations>
Quellenangaben auswerten
Sobald das Modell Quellenangaben ausgibt, musst du sie aus dem Antworttext extrahieren. So kannst du Quellen-IDs auflösen, Links anzeigen oder die unverarbeiteten Marker entfernen, bevor du die Antwort anzeigst.
Die folgenden Hilfsfunktionen kannst du direkt in deine Anwendung kopieren. Sie erkennen Verweise auf einzelne oder mehrere Quellen sowie optionale Zeilenbereiche. Dabei bleiben die Zeichenpositionen im ursprünglichen Text erhalten.
Das Beispiel unterstützt nur Zeilenbereiche als Fundstellenangaben. Passe es an, wenn dein System ein anderes Format verwendet.
Wenn deine Quellen-IDs anders aufgebaut sind, passe SOURCE_ID_RE an das Format deines Systems an.
Beispiele
Die folgenden Beispiele zeigen zwei gängige Vorgehensweisen für Quellenangaben:
Über ein Tool abgerufener Kontext: Dein Tool liefert zitierfähiges Material mit den zugehörigen IDs.
Direkt eingefügter Kontext: Du stellst zitierfähige Blöcke direkt im Prompt bereit.
Quellenangaben für über ein Tool abgerufenen Kontext formatieren
Verwende dieses Muster, wenn das Modell Kontext über ein Tool abruft und in seiner Antwort auf dieses Material verweist.
Zitierfähige Einheiten festlegen
Wähle die zitierfähigen Einheiten danach aus, wie genau die Quellenangaben für deinen Anwendungsfall sein müssen. Die folgenden Beispiele zeigen mögliche Ausgaben eines Tools.
Für die Ausgabe empfehlen sich Formate wie die folgenden. Welches Tool du verwendest, hängt von deiner Anwendung ab. Wichtig ist vor allem, dass die Ausgabe wie in den Beispielen klar und einheitlich strukturiert ist.
So kann die Ausgabe eines Tool-Aufrufs aussehen:
Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file0{CITATION_STOP}[L1] The service agreement states that termination for convenience requires thirty (30) days’ written notice, unless superseded by a customer-specific addendum.[L2] In practice, renewal terms auto-extend for successive one-year periods when no written non-renewal notice is received before the deadline.[L3] Appendix B further clarifies that pricing exceptions must be approved in writing by both Finance and the account owner.Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file1{CITATION_STOP}...
Hier ist turn0file0 die stabile Quellen-ID. Die Zeilennummern geben die Fundstellen an.
So kann die Ausgabe eines Tool-Aufrufs aussehen:
Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file0{CITATION_STOP}[Block1]The service agreement states that termination for convenience requires thirty (30) days’ written notice, unless superseded by a customer-specific addendum.In practice, renewal terms auto-extend for successive one-year periods when no written non-renewal notice is received before the deadline.Appendix B further clarifies that pricing exceptions must be approved in writing by both Finance and the account owner.Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file1{CITATION_STOP}[Block2]...
Wenn du ganze Blöcke statt einzelner Zeilen zitieren möchtest, gib jedem abgerufenen Block eine eigene stabile Quellen-ID. Verwende für den Verweis weiterhin dasselbe Format mit zwei Feldern, zum Beispiel {CITATION_START}cite{CITATION_DELIMITER}turn0file0{CITATION_STOP}. So brauchst du keinen eigenen Typ für Quellenangaben auf Blockebene.
Anweisungen für den Prompt schreiben
## CitationsResults are returned by "tool_1". Each message from `tool_1` is called a "source" and identified by its reference ID, which is the first occurrence of `turn\\d+file\\d+` (for example, `turn0file0` or `turn2file1`). In this example, the string `turn0file0` would be the source reference ID.Citations are references to `tool_1` sources. Citations may be used to refer to either a single source or multiple sources.A citation to a single source must be written as:{CITATION_START}cite{CITATION_DELIMITER}turn\d+file\d+{CITATION_STOP}If line-level citations are supported, a citation to a specific line range must be written as:{CITATION_START}cite{CITATION_DELIMITER}turn\d+file\d+{CITATION_DELIMITER}L\d+-L\d+{CITATION_STOP}Citations to multiple sources must be written by emitting multiple citation markers, one for each supporting source.You must NOT write reference IDs like `turn0file0` verbatim in the response text without putting them between {CITATION_START}...{CITATION_STOP}.- Place citations at the end of the supported sentence, or inline if the sentence is long and contains multiple supported clauses.- Citations must be placed after punctuation.- Cite only retrieved sources that directly support the cited text.- Never invent source IDs, line ranges, or block locators that were not returned by the tool.- If multiple retrieved sources materially support a proposition, cite all of them.- If the retrieved sources disagree, cite the conflicting sources and describe the disagreement accurately.
Beispielausgabe:
The on-call handoff process is documented in the weekly support sync notes. \ue200cite\ue202turn0file0\ue202L8-L13\ue201
Quellenangaben für direkt eingefügten Kontext formatieren
Verwende dieses Muster, wenn du den Kontext vorab abrufst oder aufbereitest und direkt in den Prompt einfügst.
Zitierfähige Einheiten festlegen
Wenn du Kontext direkt einfügst, kannst du die einzelnen Quellenabschnitte mit Tags umschließen, die stabile Referenz-IDs enthalten.
12345678910<BLOCK id="block1">The service agreement states that termination for convenience requires thirty (30) days’ written notice, unless superseded by a customer-specific addendum.In practice, renewal terms auto-extend for successive one-year periods when no written non-renewal notice is received before the deadline.Appendix B further clarifies that pricing exceptions must be approved in writing by both Finance and the account owner.</BLOCK><BLOCK id="block2">Syllabus</BLOCK>...
So erkennt das Modell, welcher Abschnitt eine zitierfähige Einheit bildet, und kann leicht darauf verweisen.
Anweisungen für den Prompt schreiben
## CitationsSupporting context is provided directly in the prompt as citable units. Each citable unit is identified by the value of its `id` attribute in the first occurrence of a tag such as `<BLOCK id="block5"> ... </BLOCK>`. In this example, `block5` would be the source reference ID.Because this pattern does not invoke tools, there is no tool turn counter to increment. That means you do not need to use a `turn#` prefix for the citation marker. You can keep IDs in a `turn0block5` style if that matches the rest of your system, or use plain IDs like `block5` as shown here. The key requirement is that the citation marker matches the injected context ID exactly and consistently.Citations are references to these provided citable units. Citations may be used to refer to either a single source or multiple sources.A citation to a single source must be written as:{CITATION_START}cite{CITATION_DELIMITER}<block_id>{CITATION_STOP}For example:{CITATION_START}cite{CITATION_DELIMITER}block5{CITATION_STOP}Citations to multiple sources must be written by emitting multiple citation markers, one for each supporting block.You must NOT write block IDs verbatim in the response text without putting them between {CITATION_START}...{CITATION_STOP}.- Place citations at the end of the supported sentence, or inline if the sentence is long and contains multiple supported clauses.- Citations must be placed after punctuation.- Cite only blocks that appear in the provided context.- Never invent new block IDs.- Never cite outside knowledge or outside authorities.- If multiple blocks materially support a proposition, cite all of them.- If the provided blocks conflict, cite the conflicting blocks and describe the conflict accurately.
Beispielausgabe:
The Court held that the District Court lacked personal jurisdiction over the petitioner. \ue200cite\ue202block5\ue201
Hinweis: Von OpenAI gehostete Tools wie die Websuche fügen Quellenangaben automatisch direkt im Text ein. Wenn du gehostete Tools verwenden möchtest, findest du weitere Informationen in der
Tool-Übersicht,
im Leitfaden zur Websuche und
im Leitfaden zur Dateisuche.