For the complete documentation index, see llms.txt. Every page on this site is also served as Markdown: append `.md` to any URL, or send `Accept: text/markdown`.
Skip to content
Attensira LogoAttensira
Start free

Codex CLI: read your AI citations from the shell, key kept out of config

Export a workspace API key as ATTENSIRA_API_KEY, then run codex mcp add attensira --url https://mcp.attensira.com/mcp --bearer-token-env-var ATTENSIRA_API_KEY. Codex reads the key at runtime and sends it itself, so it never enters config.toml. Codex can then read your citations per engine and day, the prompts you lose and the crew's waiting work.

7 days free · card requiredHow the trial works

Codex CLIattensira · attensira.com

Asked: How often have answers cited attensira.com in the last four weeks, per engine?

called citation_timeline domain_or_url=attensira.com days=28

1,442 citations, and nearly all of them since 24 September. The number of tracked prompts citing us rose the same day, so read the answers before reading anything into it.

ChatGPT, 6 to 23 September
0 to 8 a day
1 or 2 prompts citing us
ChatGPT, 24 September to 3 October
81 to 157 a day
3 to 6 prompts citing us
Perplexity, from 24 September
11 to 30 a day
none before
Total, 28 days
1,442
ChatGPT 1,235 · Perplexity 207

A timeline is what changed, not why.

attensira.com workspace, read over the Attensira MCP ·

Who does the work

  • Researcher agentResearcher · Read the sources

How do I connect Codex CLI?

The configuration to paste
export ATTENSIRA_API_KEY="atn_live_…"   # in your shell profile

codex mcp add attensira --url https://mcp.attensira.com/mcp \
  --bearer-token-env-var ATTENSIRA_API_KEY

What are the limits from the shell?

  • Codex connects with a static key, not OAuth. A key never expires until revoked, so revoke it under Settings → Your assistant when the job it was minted for ends.
  • A citation timeline does not say why a line moved. More prompts tracked, a provider change or a page change can all make the same step.
  • A read-only key cannot write. A write tool returns 403 insufficient_scope, and a key's scope cannot be widened; mint a read-and-write key and swap it in.
  1. Step 01

    Mint a key and export it

    Mint a workspace API key under Settings → Your assistant, read-only if Codex only reads. It is shown once, because only a hash is stored. Export it as ATTENSIRA_API_KEY in your shell profile.

  2. Step 02

    Add the server with the env-var flag

    Run codex mcp add with the server URL and --bearer-token-env-var naming the variable. Codex reads the token at runtime and sends the Authorization header itself, so the key never enters ~/.codex/config.toml.

  3. Step 03

    Set the variable where Codex launches

    The variable has to exist in the shell profile Codex starts from. A key exported only in the terminal you tested in is missing when Codex starts another way, which shows up as an authentication failure.

  4. Step 04

    Fall back to a literal only if you must

    If your Codex build has no --bearer-token-env-var, write the key into config.toml under an http_headers table. Treat that file as a secret, keep it out of every repository, and restart Codex after editing.

What do the engines read for an API question?

For “AI search visibility API”, the answers lean on SE Ranking's pages and a run of small vendor sites, and none of 24 cites us. Codex can read the same board and draft the page that is missing.

Cited inn=24 answers
“AI search visibility API”, ChatGPT and Perplexity, 3 of 31 days sampled · to
NameCited in
seranking.com87.5%
keyword.com75.0%
github.com54.2%
agenticfabriq.com50.0%
cituna.com50.0%
attensira.comyou0.0%
Researcher agentResearcher · Read the sourcesattensira.com prompt board, read over the Attensira MCP · · n=24 answers

What can Codex read from the shell?

  • Read citations per engine and per day for your domain or one page, with the mean position, from the shell or a script.
  • Check, in a CI step after a deploy, whether the pages you changed are being cited, then measure properly at the +7, +14 and +30 day re-reads.
  • Read the prompts you lose and who wins them, and what the crew has waiting for approval.
  • Run unattended. The key does not expire until you revoke it, which suits a scheduled or CI job.

What did Codex show on our own workspace?

Almost all of the window's citations came after 24 September, and on the same day the number of our tracked prompts that cited us rose too. That points first at what we were tracking, not at anything we shipped, and the answers are where to confirm it. A timeline tells you a line moved. It never tells you why.

What does a short answer to a tool question name?

Perplexity's answer to “LLM SEO tool” on 3 Oct names no tool at all and links ten listicles. Codex can pull answers like this one by prompt and day, so a script can watch which roundups the engines lean on.

Answer · Perplexityasked

Question: LLM SEO tool

Perplexity answered: LLM SEO tools help brands gain visibility in AI-generated answers by tracking citations and optimizing content for AI surfaces. Popular options cover citation tracking across models like ChatGPT, Perplexity, Gemini, and Google AI, plus content/schema optimization and analytics.

Sources cited

  1. 1lovedby.ai
  2. 2seo.co
  3. 3aiclicks.io
  4. 4merchynt.com
  5. 5, 8llmrefs.com
  6. 6docdigitalsem.com
  7. +3 more

Not namedAttensira is missing from this Perplexity answer.

Researcher agentResearcher · Stored the answerattensira.com stored Perplexity answer, read over the Attensira MCP · · 10 links

What should a deploy check report?

Coverage, not a verdict. Right after a deploy, read whether the changed pages are being fetched and cited at all. The verdict comes from Attensira's own re-reads of each shipped change at +7, +14 and +30 days, each comparing a week before the change with a week around the re-read, and a change inside the noise is reported as no change. A script that reports movement every day is reporting sampling. Name each key after the job it serves, so revoking one breaks nothing else.

Questions about Codex CLI

Does the key end up in ~/.codex/config.toml?
Not with --bearer-token-env-var. Codex reads the token from the named variable at runtime and sends it as the Authorization header itself; the config only names the variable.
Codex says authentication failed but the key is right. Why?
Usually the variable is not set in the environment Codex starts from. Put the export in your shell profile rather than in one terminal session.
Can Codex sign in with OAuth instead?
Attensira's documented path for Codex CLI is a static key. Clients that sign in, such as Claude Code, Cursor and VS Code, need no key at all.
Should the key be read-only?
If Codex only reads, yes. Choose the scope when you mint it; it cannot be widened afterwards.
I lost the key. Can Attensira show it again?
No. Only a hash is stored, so a lost key is replaced, not recovered. Revoke it and mint a new one.

Where do these facts come from?

  1. Attensira's connect documentation states that Codex reads the token from a named environment variable at runtime and sends it as the Authorization header itself, so the key never enters config.toml.

    docs.attensira.com · retrieved

    “Codex reads the token from a named environment variable at runtime and sends it as the Authorization header itself, so the key never enters ~/.codex/config.toml”
  2. Attensira's connect documentation states that a key is shown exactly once because only a hash is stored, and that Attensira cannot re-display it.

    docs.attensira.com · retrieved

    “It is shown exactly once: only a hash is stored, so Attensira cannot re-display it.”
  3. Attensira's MCP overview states that a static API key never expires until it is revoked.

    docs.attensira.com · retrieved

    “Never, until you revoke it”

Script a citation check into the shell you deploy from.

7 days free · card requiredHow the trial works

Start free

7 days free · card requiredHow the trial works

attensira.com's own workspace · read 4 Oct 2026 · n=4,518

197/ 4,518 answers4.4%

Answers on ChatGPT and Perplexity that named attensira.com. Our own reading, published with its n.Sites we own · not customers · 24 of 31 days sampled