Organizing Inline Web Search Citations in the Response API

When producing research, professional output design is very important.

The default output of inline web search citations is placing the URLs inside many (if not all) paragraphs of the response - many times duplicating URLs in differant paragraphs. While this is somewhat effective, it is not optimal for professional research.

An alternative approach would be to create a Reference section at the end of the response which lists all the inline web search citations and URLs in one place.

Here is an Instruction Prompt which does just that:

All web search citations must be placed only in a final section titled Reference appended to the end of the response. The main body of the response must not contain any inline citations or source markers.

  1. Do not include any citation formats in the main body of the response. This prohibition covers bracketed numbers, author year parentheticals, footnotes, superscripts, endnote markers, or link footers.
  2. Append a single section at the end of the response titled Reference.
  3. In the Reference section, list every source used via web search, one per line, including author or organization, title, publisher or site, publication date if available, access date, and the source URL.
  4. Order the entries by their first point of use in the body.
  5. Do not add commentary or analysis inside the Reference section.
  6. Do not place citations anywhere other than the Reference section.

Our tests indicates that the above instruction prompt works - most of the time. In all tests, the Reference section is always created. However, sometimes URLs are still placed in paragraphs of the main body.

It appears that OpenAI does not enforce instruction prompts entirely - which is a shame.

Edit: This works best when information can legally be obtained from web sites without violating publisher policies. For example: We are providing analysis to update dated Employee Handbooks in California to comply with recent California Labor Code. The searched websites are state an local agencies which allow unfettered access.

2 Likes

That’s a really solid observation — and your prompt is impressively well-structured. I’ve noticed the same issue: even with explicit formatting instructions, the model occasionally falls back to inline citations when web data is dense or heavily interlinked.

It seems the current web search citation behavior is still handled by a system-level layer that sometimes overrides user formatting rules. Hopefully, future API updates will allow finer-grained control over how citations are rendered (e.g., toggling between inline, footnote, or reference list modes).

Until then, one workaround is to post-process the output: detect and extract URLs from the text, then programmatically move them into a generated “Reference” section. It’s not ideal, but it keeps your final reports consistent and professional.

1 Like

Thank you for your thoughtful response.

It seems the current web search citation behavior is still handled by a system-level layer

Yes, it appears that’s the case.

Hopefully, future API updates will allow finer-grained control over how citations are rendered

Ideally, OpenAI could offer parameters for this.

The only thing that the instruction prompt consistently accomplishes is creating the “Reference” section with citation source, title, and URL, line-by-line. Half the time, inline citations still remain in the main body.