Clinical referenceBuild guide, rankedUpdated November 2026

OpenAI Codex for physicians: build your own clinical tools with cited answers (2026)

In this guide, EvidenceMD ranks first for bringing cited clinical answers into Codex in 2026. Codex is OpenAI's coding agent: it reads and writes files and runs commands, so a physician who has never written software can describe a small tool and watch it get built, the approach often called vibe coding, but it writes medical content from training [6][7][21]. EvidenceMD is a clinical reasoning platform: in its own app it shows its full chain-of-thought, and through its MCP server and API it returns the worked answer, each with a citation for every claim drawn from 40 million+ peer-reviewed papers and clinical guidelines [1][2]. It connects to Codex through one entry in ~/.codex/config.toml with a 180-second tool timeout, and its OpenAI-compatible API puts the same cited answers inside the tools you build, at US$0.20 a request [1][2][3].

How long Codex waits for an MCP tool by default
60 sHow long Codex waits for an MCP tool by default
Read-only public-data apps in OpenAI's Healthcare Public Data plugin
9Read-only public-data apps in OpenAI's Healthcare Public Data plugin
Codex Cloud tasks covered by OpenAI's BAA: only local Codex can be
0Codex Cloud tasks covered by OpenAI's BAA: only local Codex can be
Requests per second PubMed's free E-utilities API allows with a key (3 without)
10/sRequests per second PubMed's free E-utilities API allows with a key (3 without)
By the EvidenceMD Editorial TeamBuild guide, rankedPublished November 10, 202612 min read

Medically reviewed by Dr. Abishek Shahi, Harvard-trained Physician · Last reviewed November 10, 2026

What is the best Codex setup for physicians?

QUICK ANSWER

The best Codex setup for physicians pairs Codex with EvidenceMD: Codex writes the software, and EvidenceMD supplies the medicine as worked clinical reasoning with a citation for every claim, both while you build and inside the tools you build. Add it to ~/.codex/config.toml with a 180-second tool timeout and run codex mcp login evidencemd; Codex can then put clinical questions to it and gets back finished answers cited to guidelines and peer-reviewed papers [1]. Inside your own tools, call its OpenAI-compatible API, at US$0.20 a request on evidencemd-fast and evidencemd-pro [2][3]. In an eligible healthcare workspace, add OpenAI's Healthcare Public Data plugin for public research, trial and drug-label data, and use free public APIs such as PubMed's E-utilities elsewhere [11][13]. Build with synthetic or de-identified data: only local Codex on a HIPAA-eligible OpenAI setup with a BAA can be covered, and Codex Cloud never is [9][10].

Codex for physicians: with EvidenceMD and without. Codex with EvidenceMD versus Codex on its own on Medical content from, While you build, Inside your tool, Citations, Patient data.
Codex with and without EvidenceMD for physicians: on its own Codex writes medical content from training; with EvidenceMD's MCP server and API it gets finished clinical answers cited to guidelines and papers, both while building and inside the tools it builds.

Key takeaways

  • Codex builds the tool; it does not check the medicine. Without a connected source it writes clinical content from training, so references it gives are recalled, not retrieved [6].
  • EvidenceMD ranks first because it gives Codex a finished, cited clinical answer, through its MCP server while you build and its API inside what you build [1][2].
  • OpenAI's Healthcare Public Data plugin is the strongest built-in source, but only in supported healthcare workspaces and for US ChatGPT for Clinicians users, and it returns public data, not answers [11].
  • PHI is a narrow path in Codex. Only local Codex can handle PHI under OpenAI's BAA, on ChatGPT for Healthcare, ChatGPT for Clinicians or a Regulated workspace with Codex access set up; Codex Cloud is not covered, and third-party services Codex reaches need their own agreements [9][10].
  • Set the timeout. Codex waits 60 seconds for an MCP tool by default; EvidenceMD's configuration raises it to 180 seconds because detailed answers can take longer [1][8].
  • A tool for your own reference is not a cleared device. Anything you would use on patients needs validation and your organisation's approval first [19].

Why is EvidenceMD the first source a physician should add to Codex?

Every other source on this page hands Codex material to work from: public datasets, papers, records or test patients. EvidenceMD hands it the clinical reasoning, finished and cited. Five reasons it comes first, and the caveat that follows them.

Codex gets a clinical reasoning engine, not a search box

With the MCP server connected, Codex calls EvidenceMD's clinical_reasoning tool, which runs your question through the same engine as evidencemd.ai and returns the assessment, the evidence, the recommendation and the next step [1]. The engine publishes 54.6% on HealthBench Hard for its model, self-reported [4].

Two doors: MCP while you build, API inside what you build

The MCP server answers questions in your Codex session as you design a tool. The API puts the same kind of answer inside the finished tool, so a page you build can ask a clinical question and show a cited answer [1][2].

Cited at the claim

Answers are written after retrieval from 40 million+ peer-reviewed papers and clinical guidelines, with citations at the sentences they support, so your tool can show where each statement came from [1][4].

OpenAI-compatible, so Codex already knows the pattern

The API runs at https://evidencemd.ai/api/v1 and works with the official OpenAI SDK by changing the base URL, with models evidencemd-fast, evidencemd-pro and evidencemd-deep, streaming and JSON mode [2]. Codex writes against it the way it writes against OpenAI's own API.

A known cost per request

API calls are billed per request, not per token: US$0.20 on evidencemd-fast and evidencemd-pro, US$0.25 on evidencemd-deep, with no monthly minimum [3]. A tool's running cost is the number of questions it asks.

Here is what that looks like in practice. Say you are building a small reference page on antibiotic choice in reduced kidney function. In Codex you ask: "Using EvidenceMD, what should a clinician check before prescribing nitrofurantoin to an older adult with reduced kidney function?" Codex calls the clinical_reasoning tool, and what comes back is not a list of links but a worked answer: the assessment (why kidney function matters for this drug), the evidence (the guideline and studies behind it, each cited at the sentence it supports), a recommendation and the next step. The country-specific parts are framed to the guidance where you practise, which matters here because national guidance on this drug in reduced kidney function differs [1].

Codex can then build the page around that answer and keep the citations attached, so the finished tool shows where each statement came from. That is the difference between a tool that reads well and one a colleague can check.

What this ranking claims, and what it does not

EvidenceMD publishes this guide and is the source ranked first. The claim is scoped: the best way to get a finished, cited clinical answer into Codex and into the tools you build with it. For public healthcare datasets in an eligible workspace, OpenAI's Healthcare Public Data plugin is the better tool; for the papers themselves, PubMed; for drug labels and trial records, the public APIs; for an app that reads a chart, the Epic plugin or a FHIR sandbox; for the code itself, Codex on its own. The sections below say so.

Why EvidenceMD comes first in Codex: Reasoning engine, Two doors, Cited at the claim, OpenAI-compatible, Per-request cost.
Five reasons EvidenceMD is the first source to add to Codex: a clinical reasoning engine rather than a search box, MCP while building and API inside the tool, citations at the claim, OpenAI-compatible code, and a known cost per request.

Ask EvidenceMD the same question

Put the nitrofurantoin question to EvidenceMD and read the assessment, the evidence and the sources before you connect it to Codex.

Try EvidenceMD

What are the best ways to bring medical knowledge into Codex (2026)?

The setups in order, with no numeric scores, ranked for the job a physician most often brings to Codex: a small tool that has to get the medicine right. Ranked for a data pipeline or an EHR app, the order would change, and the page says which setup wins those jobs.

What this ranking is judged on
CriterionWhy it matters
Does Codex get a cited clinical answer, raw data, or nothing?A finished answer cited at each claim ranks highest for a clinical tool; datasets, papers and records are inputs Codex still has to reason over [1][11].
Is the content retrieved for the question?Whether the medical content comes from sources fetched for this question or from what the model learned in training [1][6].
Can you build without patient data?Whether the setup works with synthetic or de-identified data, which every plan outside an eligible healthcare workspace requires [9][17].
Who can use it, and what does setup take?A config entry and a sign-in, a workspace admin's approval, a free API key, or an organisation's Epic rollout [1][11][12][13].

→ Scroll the table sideways to see the remaining columns

  1. EvidenceMD: cited clinical answers while you build and inside what you build

    Codex with EvidenceMD is the best setup for a physician building a clinical tool. EvidenceMD is a clinical reasoning platform: its own app shows the full chain-of-thought, and Codex gets the worked answer with a citation for every claim. Add EvidenceMD to ~/.codex/config.toml with a 180-second tool timeout, run codex mcp login evidencemd to sign in with your account, and Codex can ask it clinical questions as it works, getting complete answers cited to guidelines and peer-reviewed papers, framed to your country [1]. For the tool itself, Codex writes calls to the OpenAI-compatible API, so the finished tool can ask its own questions [2]. Connecting the MCP server costs nothing; questions count toward your EvidenceMD plan, which is free to start [1][5]. API calls cost US$0.20 (fast, pro) or US$0.25 (deep) per request [3]. Limits, stated plainly: detailed answers can take up to a minute, so set the timeout; it holds no drug compendium; and OpenAI's BAA does not cover third-party services Codex reaches, so keep identifiers out [1][9].

  2. OpenAI's Healthcare Public Data plugin: public datasets inside Codex

    OpenAI's Healthcare Public Data plugin ranks second. It brings nine read-only apps into ChatGPT and Codex covering research, clinical trials, medication labels, FDA safety data, Medicare data, facility measures and provider records [11]. It is offered in supported ChatGPT for Healthcare and HIPAA-enabled Enterprise workspaces, under admin control, and to individual eligible US ChatGPT for Clinicians users [11]. It ranks below EvidenceMD for a clinical tool because it returns public data, not an answer, and it does not reach patient charts; OpenAI also says not to put PHI into its queries [11].

  3. PubMed: the papers behind a question

    PubMed ranks third and is the free literature source for any Codex user. Codex can write code against NCBI's E-utilities API, which allows 3 requests a second without a key and 10 with a free key [13]. It returns abstracts and records, not an answer, so your tool still has to read and weigh them. For a literature watch, a journal-club digest or a reading list, it is the better tool.

  4. openFDA, RxNorm and ClinicalTrials.gov: drug and trial records

    The FDA's openFDA APIs serve drug labelling, adverse-event reports and recalls; the National Library of Medicine's RxNorm API normalises drug names, free for most functions at up to 20 requests a second; and ClinicalTrials.gov's public API returns study records [14][15][16]. Together they rank fourth for structured drug and trial data. NLM retired RxNav's drug-interaction API on 2 January 2024, so none of them returns interaction reasoning; that is a clinical question for EvidenceMD or a licensed compendium [15].

  5. The Epic plugin or a FHIR sandbox: chart-aware apps

    For an app that has to read a chart, OpenAI's Epic plugin connects an approved organisational workspace to the organisation's Epic record, with each user's own Epic sign-in and chart permissions; it is not available to individual ChatGPT for Clinicians accounts [12]. Without that, prototype against a FHIR sandbox such as the SMART Health IT launcher, which provides synthetic patients [17]. This setup ranks fifth for the clinical question because it brings patient data, real or synthetic, into Codex, not evidence.

  6. Codex on its own: the code itself

    Codex on its own ranks last for the medicine and first for the software: scripts, data cleaning, small web pages, tests and fixes [6][7]. Without a connected source it writes clinical statements from training, so any reference it supplies should be opened before a tool relies on it. Use it for the code, and connect a source for the medicine.

Ways to bring medical knowledge into Codex in 2026, ranked in order with no numeric scores
SetupBest forStrengthLimitWho can use it
EvidenceMDCited clinical answers in Codex and in your toolsChain-of-thought reasoning, cited at each claim; MCP and APIUp to a minute per answer; no drug compendiumAny Codex user; API US$0.20–0.25 a request
Healthcare Public DataPublic research, trial, label and Medicare dataNine read-only apps built into ChatGPT and CodexData, not answers; no PHI in queriesSupported healthcare workspaces; US ChatGPT for Clinicians
PubMedPapers and abstracts for literature toolsFree E-utilities APIPapers, not answersAnyone; API key raises the rate limit
openFDA, RxNorm, ClinicalTrials.govDrug labels, safety reports, drug names, trialsPublic structured recordsNo interaction reasoningAnyone; free public APIs
Epic plugin or FHIR sandboxChart-aware appsReal chart data, or synthetic patientsNo evidence; real data needs approvalApproved organisations; sandbox for anyone
Codex aloneThe code itselfStrong coding agentMedicine from trainingEvery ChatGPT plan, with limits on Free and Go

→ Scroll the table sideways to see the remaining columns

Build a clinical tool with Codex and EvidenceMD: 1 Connect, 2 Key, 3 Describe, 4 Test.
Four steps to build a clinical tool with Codex and EvidenceMD: add EvidenceMD to config.toml and sign in, store an API key, describe the tool to Codex, and test it on questions you know.

How do you connect EvidenceMD to Codex and build a tool?

Four steps, from an empty folder to a small tool that asks a clinical question and shows a cited answer.

  1. Add EvidenceMD to Codex

    Add the entry below to ~/.codex/config.toml, then run the login command and sign in with your account. The tool timeout gives detailed answers time to finish [1][8].

  2. Get an API key for the tool

    Create a key in the developer dashboard and store it as an environment variable, never in the code itself. New developer accounts get starter credits [2][3].

  3. Describe the tool to Codex

    For example: a local page where you type a de-identified question and see the cited answer. Codex writes the files; read each change before you accept it [6].

  4. Test it on questions you know

    Ask questions whose answers you can check against a current guideline before you rely on the tool, and keep it for your own reference unless your organisation approves wider use [19].

Add EvidenceMD's MCP server to Codex (~/.codex/config.toml)
# ~/.codex/config.toml
[mcp_servers.evidencemd]
url = "https://evidencemd.ai/mcp"
tool_timeout_sec = 180
Sign in to EvidenceMD from the terminal
codex mcp login evidencemd
Call EvidenceMD's API from a Python tool (OpenAI SDK)
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["EVIDENCEMD_API_KEY"],
    base_url="https://evidencemd.ai/api/v1",
)

reply = client.chat.completions.create(
    model="evidencemd-pro",
    messages=[{
        "role": "user",
        "content": "First-line treatment for uncomplicated cystitis "
                   "in a non-pregnant adult woman?",
    }],
)

print(reply.choices[0].message.content)

The same pattern covers most first tools: a discharge-teaching page that turns a diagnosis into a cited, plain-language summary you review before printing; a journal-club helper that pairs the cited answer with the PubMed abstracts behind it; a teaching quiz built from cited answers. In each, Codex writes the software, EvidenceMD supplies the clinical answer, and you check it [1][2][13]. If you would rather build in Claude Code, the companion guide uses the same EvidenceMD server and API [18]; for cited answers in ChatGPT itself, see our ChatGPT for doctors guide [20].

Clinicians are already building this way: a 2026 review by clinicians describes vibe coding as a way to prototype tools for workflow problems vendors overlook, with guardrails, and not a replacement for software developers [21].

Get an EvidenceMD API key

Create a key, store it as an environment variable and run the Python example above against a question you already know the answer to.

Get an API key

How can a physician build with Codex safely?

Five rules that hold on every ChatGPT plan.

Build with synthetic or de-identified data

Only local Codex (the app, CLI or IDE extension) can be covered by OpenAI's BAA, and only on ChatGPT for Healthcare, ChatGPT for Clinicians or a Regulated workspace with the required Codex access. Codex Cloud is not covered, and third-party services Codex reaches, EvidenceMD included, need their own agreements [9][10].

Keep API keys out of your code

Store keys in environment variables or a secrets manager, and never paste them into a prompt or commit them to a repository. Each API request is billed, so a leaked key costs money [3].

Read what Codex changes

Review each file edit and command before you accept it, especially anything that sends data to an outside service. Codex is fast; the decision to run its work is yours.

Test against answers you know

Check the tool's output on cases with a clear guideline answer before you trust it on new ones, and open the citation behind any claim you would act on [1].

Know when a tool becomes a device

Software that guides treatment for patients can fall under the FDA's clinical decision support guidance. Keep personal tools personal, and take anything patient-facing through your organisation's review [19].

When is EvidenceMD not the right choice in Codex?

A guide that names no losses is advertising. Four situations where EvidenceMD is the wrong thing to connect, and what to use instead.

You need public datasets inside an eligible healthcare workspace

Use OpenAI's Healthcare Public Data plugin for research, trials, labels, FDA safety, Medicare and provider data. It returns the data itself [11].

You are building a literature pipeline

Use PubMed's E-utilities API. It returns the papers; EvidenceMD returns an answer, not a bibliography [13].

You need FDA label text, adverse-event counts, recalls or trial records

Use openFDA and the ClinicalTrials.gov API. Structured regulatory and trial data comes straight from the source [14][16].

Your app has to read a patient's chart

Use the Epic plugin in an approved workspace, or prototype against a FHIR sandbox. EvidenceMD answers the clinical question; it does not read your EHR [12][17].

Which Codex setup fits your role?

The right setup depends on your ChatGPT plan, what you are building and who will use it. Five common situations.

Physician who has never coded, on ChatGPT Plus or Pro

Add EvidenceMD to Codex, ask for one small local tool, and keep every input de-identified: Plus and Pro carry no BAA [1][6][10].

US physician on ChatGPT for Clinicians

Install the Healthcare Public Data plugin for public datasets and add EvidenceMD for cited clinical answers; still keep PHI out of public-data queries and out of third-party services [1][11].

Physician building a small app for colleagues

Use EvidenceMD's API for the clinical answers, keep keys in environment variables, budget per request, and agree with your organisation who reviews the tool before others use it [2][3][19].

CMIO or clinical informatics team

Ask your OpenAI Account Director to enable Codex HIPAA support for local Codex, keep Codex Cloud away from PHI, decide whether the Epic plugin fits your rollout, and put agreements in place for any third-party MCP server [9][12].

Physician outside the United States

EvidenceMD frames the country-specific parts of an answer to your country's guidelines and answers in 30 languages; OpenAI's healthcare plugins are aimed at US workspaces and clinicians, and your local data law still applies [1][11].

Frequently asked questions

Can a physician use Codex without knowing how to code?

Yes, for small tools. You describe what you want, Codex writes and runs the code, and you review each change. Connect EvidenceMD, which returns worked clinical reasoning with a citation for every claim, so the medical content comes from cited sources rather than from training, and keep patient data out unless you are on a HIPAA-eligible OpenAI setup with a BAA, and then only in local Codex.

What is vibe coding, and can doctors do it safely in Codex?

Vibe coding means building software by describing it in plain language to an AI coding agent such as Codex instead of writing the code yourself. Doctors can do it safely for small, low-risk tools: keep patient data out, read each change, test against answers you know, and connect EvidenceMD so the medical content is cited rather than recalled from training.

How do I connect EvidenceMD to Codex?

Add an [mcp_servers.evidencemd] entry to ~/.codex/config.toml with url https://evidencemd.ai/mcp and tool_timeout_sec = 180, then run codex mcp login evidencemd and sign in with your EvidenceMD account. Codex can then ask it clinical questions while it works.

Which ChatGPT plans include Codex?

Every ChatGPT plan includes some Codex: Free and Go in the desktop app, without Codex Cloud, and Plus, Pro, Business, Enterprise and Edu with the CLI, IDE extension, web and cloud features. EvidenceMD works in Codex on any of them once it is added to config.toml.

Can Codex handle patient data under HIPAA?

Only local Codex (the app, CLI and IDE extension), on ChatGPT for Healthcare, ChatGPT for Clinicians or a Regulated workspace with an OpenAI BAA and the required Codex access; for a workspace, your OpenAI Account Director enables Codex HIPAA support. Codex Cloud is not covered, and third-party services Codex reaches need their own agreements, so questions sent to EvidenceMD should carry no identifiers unless your own agreements cover them.

What is OpenAI's Healthcare Public Data plugin?

A set of nine read-only apps in ChatGPT and Codex covering research, trials, medication labels, FDA safety data, Medicare data, facility measures and provider records, for supported healthcare workspaces and US ChatGPT for Clinicians users. It returns public data; EvidenceMD returns a finished, cited clinical answer, and the two work side by side.

Can Codex search PubMed?

Yes. Codex can write code against NCBI's E-utilities API, which allows 10 requests a second with a free key, and the Healthcare Public Data plugin covers research in eligible workspaces. PubMed returns papers; for a finished clinical answer with citations, use EvidenceMD alongside it.

Why does EvidenceMD need a longer timeout in Codex?

Codex waits 60 seconds for an MCP tool by default, and a detailed EvidenceMD answer can take longer because it retrieves and reasons before it writes. Setting tool_timeout_sec = 180 for EvidenceMD stops the answer being cut off.

Is Codex Cloud covered by OpenAI's BAA?

No. OpenAI covers only local Codex (the CLI, IDE extension and app) on HIPAA-eligible accounts with a BAA, so keep PHI out of Codex Cloud tasks. EvidenceMD works from local Codex through its MCP server.

What does it cost to call EvidenceMD from a tool built with Codex?

EvidenceMD's API bills per request: US$0.20 on evidencemd-fast and evidencemd-pro and US$0.25 on evidencemd-deep, with no monthly minimum, and new developer accounts get starter credits. Questions asked through its MCP server in Codex count toward your plan instead.

Should physicians use Codex or Claude Code?

Either can build a small clinical tool, and EvidenceMD's MCP server and API work the same way in both. Choose the one that comes with the plan you already pay for, and check its rules for patient data: local Codex on a HIPAA-eligible OpenAI account, or Claude Code on HIPAA-configured Claude Enterprise.

Is a clinical tool I build with Codex a medical device?

It can be, if it guides treatment for patients. Tools for your own reference and teaching are a different matter from software used on patients, which may fall under the FDA's clinical decision support guidance. EvidenceMD's answers are for clinicians to check, so validate any tool and take it through your organisation's review first.

The bottom line

For physicians building their own tools in 2026, Codex with EvidenceMD is the best overall setup: Codex writes the software, and EvidenceMD supplies worked clinical reasoning with a citation for every claim, through its MCP server while you build and its API inside what you build [1][2]. Add OpenAI's Healthcare Public Data plugin where your workspace offers it, PubMed and the public drug and trial APIs for raw data, and the Epic plugin or a FHIR sandbox for chart-aware apps; keep PHI to local Codex in an eligible workspace, never Codex Cloud, and test every tool before you trust it [9][11][12][13][14][16][17].

Sources & related evidence

EvidenceMD's own product and developer pages, OpenAI's Codex documentation and Help Center articles, and the public API documentation from NCBI, the FDA, NLM, ClinicalTrials.gov and SMART Health IT, opened in November 2026.

About EvidenceMD

EvidenceMD is a clinical reasoning platform for health professionals and medical and clinical researchers. Its MCP server brings cited clinical answers into Codex, Claude Code, Claude and Cursor, and its OpenAI-compatible API brings them into the tools developers build, from 40 million+ peer-reviewed papers and clinical guidelines. Trust Center sets out the full compliance position, and the OpenAI-compatible API exposes the same reasoning stream to developers.

Related reading

Connect EvidenceMD to Codex

Add EvidenceMD to your Codex config for cited clinical answers while you build, and use the API for the tools you build.