Per the English Wikipedia guideline,
Links inserted with |url= are expected to be free to read by default
(Other wikis generally have similar policies on the external links targets.)
Yet, when I enter a DOI, Citoid produces citations which invariably contain the DOI.org/<DOI> resolved target URL in the url parameter.
For instance, the answer of https://en.wikipedia.org/api/rest_v1/data/citation/zotero/10.1109%2fICSE.2012.6227139 points to a paywall:
{ "url":"https://ieeexplore.ieee.org/document/6227139/" ... }
To avoid having a complex logic on whether to have an url parameter or not, it would be enough to instead use the oadoi.org/<DOI> target URL, which will be the same as DOI.org's if no open access version is known.
Then, the answer of Citoid would point to the open-access version
{ "url":"http://arxiv.org/pdf/1203.5188" ... }