uv: Read the uv skill and follow its Setup instructions to ensure
uv is installed and on PATH.
User Notification: If .licenses/literature_search_openalex_LICENSE.txt
does not already exist in the workspace root directory then (1) prominently
notify the user to check the terms at https://developers.openalex.org/ and
to always check the license of the papers retrieved by the skill for any
restrictions, then (2) create the file recording the notification text and
timestamp.
.env file: Make sure the .env file exists in your home directory.
Create one if it does not exist.
OPENALEX_API_KEY (optional but recommended): Enables the OpenAlex
Premium API with higher rate limits. The skill works without it (using the
free "polite pool"). You can obtain a key at OpenAlex.org → account
settings. You MUST use the safe credentials protocol in the
credentials skill to check for and request this key if this skill looks
relevant to the user's request.
Core Rules
List Sources. If this skill is used, ensure this is mentioned in the
output AND list the URLs of all papers that were used in producing the
output.
Resolve before filter. NEVER filter by name. Always resolve a name to
an ID first, then use that ID in --filter.
Use the CLI only. Never call the API via curl/urllib. The CLI
handles retries and rate limiting.
No fabrication. Never invent OpenAlex IDs or DOIs. Use resolve/get
to look them up. Report empty results accurately.
API key. If a command returns 401/429 or you need high-volume queries,
you MUST use the safe credentials protocol in the skill to
check for and request the to help the user add it to
their file.
credentials
OPENALEX_API_KEY
.env
Keep output small. Always use --select and --per-page 5–10 for
overview queries. Pipe filter output to a file (> results.json), then
slim with jq before reading into context.
Rate Limits
With key: ~10 req/s, $1/day free budget.
Without key: Very limited, $0.01/day budget.
Operation
Cost
Singleton get
Free
filter
$0.0001
--search / resolve
$0.001
download-pdf
$0.01
CLI Reference
uv run scripts/openalex_cli.py [--api-key KEY] <command> [flags]
--select <fields>: Limit the fields returned in the output.
--group-by <field>: Aggregate results by a specific field.
--per-page <N>: Number of results per page (default 25, max 100).
--page <N>: Specify the page number to retrieve.
--sample <N>: Get a random sample of up to 10,000 results.
--seed <N>: Seed for reproducible sampling.
download-pdf<work-id> <output-path> — Download PDF (requires API key).
Falls back to alternative pdf_url locations if primary fails. Whenever you
download a PDF, verify it is not empty or corrupted.
rate-limit — Check current rate limit status (requires API key).
Search Tips
If resolve returns no matches, try alternate spellings or abbreviations.