WEBVTT

00:00:00.900 --> 00:00:03.968
How much does the University of Arkansas
publish each year?

00:00:04.480 --> 00:00:07.487
Ask your agent, and it asks OpenAlex.

00:00:10.356 --> 00:00:15.826
25,613 works in ten years,
counted by one web address.

00:00:16.277 --> 00:00:20.665
No key, and the answer even says
what it cost: a hundredth of a cent.

00:00:24.400 --> 00:00:27.884
AI for

00:00:28.235 --> 00:00:31.538
Research Efficiency. Episode 10:
Research APIs, a ladder of keys.

00:00:33.900 --> 00:00:39.388
Last time: what never goes to an agent,
and why keys live in a .env file.

00:00:40.088 --> 00:00:44.620
In this episode: three research services,
and the three kinds of key they take:

00:00:44.992 --> 00:00:49.142
none, a free key you limit,
and a key that spends money.

00:00:53.300 --> 00:00:56.622
One: an API is a door for programs.

00:00:57.498 --> 00:01:00.861
You ask with a web address,
and the answer comes back as JSON:

00:01:01.091 --> 00:01:03.393
plain text that a program can read.

00:01:05.136 --> 00:01:09.793
OpenAlex adds what each answer cost, and
how much of today's allowance is left.

00:01:12.500 --> 00:01:14.422
Two: no key at all.

00:01:15.184 --> 00:01:20.234
OpenAlex catalogs the world's research:
works, authors, institutions.

00:01:20.565 --> 00:01:23.530
Its data is free to reuse,
for anything.

00:01:24.777 --> 00:01:27.241
Ask the agent to read
the documentation first.

00:01:27.552 --> 00:01:31.939
Names are ambiguous, so it finds the
university's ID before it counts.

00:01:34.149 --> 00:01:36.917
One request groups ten
years of works by year.

00:01:37.269 --> 00:01:41.299
It's only a web address: open it in a
browser, and the numbers are the same.

00:01:43.266 --> 00:01:47.979
Without a key, you get ten cents of use
a day: about 1,000 of these requests.

00:01:48.330 --> 00:01:50.695
A free key gives you ten times that.

00:01:55.700 --> 00:01:58.243
Three: a free key you limit.

00:01:59.045 --> 00:02:01.126
Your reference library is private.

00:02:01.397 --> 00:02:04.309
Zotero's API needs a key to read it,

00:02:04.359 --> 00:02:07.781
and you choose what the key may do:
read, and nothing else.

00:02:09.361 --> 00:02:14.665
The key goes in the .env file, never into
the chat, even where a guide suggests it.

00:02:14.915 --> 00:02:17.377
The agent gets only
the variable's name.

00:02:18.817 --> 00:02:21.862
Then ask:
is anything in my library retracted?

00:02:22.253 --> 00:02:25.709
Here the library is
exported as a list of DOIs,

00:02:25.820 --> 00:02:30.387
and the agent checks each one against
OpenAlex. Single lookups are free.

00:02:32.308 --> 00:02:37.222
One comes back retracted, a flag OpenAlex
takes from the Retraction Watch database.

00:02:37.554 --> 00:02:39.860
Open the notice,
and confirm it yourself.

00:02:41.500 --> 00:02:46.110
Notice the agent's note, too: it
calls OpenAlex's email lane optional.

00:02:46.361 --> 00:02:48.094
That lane closed in February,

00:02:48.205 --> 00:02:51.512
which is why you ask an agent
to read the current documentation.

00:02:52.832 --> 00:02:55.184
When the work is done,
delete the key.

00:02:58.100 --> 00:03:00.239
Four: where a key can go.

00:03:01.140 --> 00:03:06.066
Claude Code can be told never to read
the .env file, and here it refused.

00:03:06.276 --> 00:03:08.739
But a script it ran
could still read the key.

00:03:10.479 --> 00:03:13.663
Codex has a setting for
which variables reach its commands,

00:03:13.813 --> 00:03:18.318
and by default it doesn't remove names
with KEY, SECRET or TOKEN in them.

00:03:19.618 --> 00:03:24.026
Antigravity's sandbox blocks
.env files, but in its command line,

00:03:24.076 --> 00:03:26.720
the sandbox is off
until you turn it on.

00:03:28.064 --> 00:03:31.154
So in all three:
the key stays in the file,

00:03:31.345 --> 00:03:35.397
the agent gets its name,
and you read what a script prints.

00:03:38.900 --> 00:03:41.567
Five: a key that spends money.

00:03:42.330 --> 00:03:44.813
ElevenLabs turns text into speech.

00:03:45.144 --> 00:03:48.568
It's paid, and it's the service
that narrates this series.

00:03:49.963 --> 00:03:52.389
Before a paid request, estimate.

00:03:52.781 --> 00:03:56.701
This summary of the practice
folder's paper is 401 characters:

00:03:56.992 --> 00:03:58.716
about 45 credits.

00:04:00.441 --> 00:04:04.811
Make a key for this job only:
text to speech, with a credit limit.

00:04:05.143 --> 00:04:09.713
The request names the key's variable,
and the key itself never appears.

00:04:11.330 --> 00:04:13.580
Then listen before you use it.

00:04:14.539 --> 00:04:16.327
summary.mp3:
Draining rice paddies now and then,

00:04:16.478 --> 00:04:19.208
instead of keeping them flooded,
cuts methane.

00:04:21.189 --> 00:04:25.979
And check the license: ElevenLabs'
free plan is for non-commercial use,

00:04:26.110 --> 00:04:30.198
with its name in the title. Paid
plans include a commercial license.

00:04:34.100 --> 00:04:35.889
Six: manners.

00:04:36.754 --> 00:04:41.063
401 or 403 means no key,
or the wrong one.

00:04:41.334 --> 00:04:47.005
429 means too many requests:
wait, and try again, more slowly.

00:04:48.765 --> 00:04:50.788
And data comes with a license.

00:04:51.118 --> 00:04:56.435
OpenAlex's is free for any use; some
services allow only non-commercial use,

00:04:56.746 --> 00:05:01.672
and Google Scholar has no API at all.
The companion page lists them.

00:05:05.300 --> 00:05:06.882
Pause here, and try one:

00:05:07.272 --> 00:05:10.826
ask your agent for your campus's
works per year from OpenAlex.

00:05:11.197 --> 00:05:14.460
No key needed.
Then open the address it used.

00:05:19.700 --> 00:05:23.847
So: no key, a key you limit,
a key that spends.

00:05:24.278 --> 00:05:26.472
Each key in the .env file,

00:05:26.803 --> 00:05:30.489
each paid request estimated,
each answer checked.

00:05:33.900 --> 00:05:37.137
Next: Map a research
field with OpenAlex.
