Tavily API Key: Python Setup, Pricing and Rate Limits
摘要
Tavily 的 API Key 需在仪表盘创建并保存在后端,通过 Authorization: Bearer 头认证 Search 请求。每月含 1,000 免费 credits 且无需信用卡,按量付费为每 credit $0.008;开发密钥一般限 100 请求/分钟,生产密钥一般限 1,000 请求/分钟。
摘要由模型根据原文撰写,以原文为准。
正文 · 原文
Create a Tavily API key in the dashboard and keep it on your backend. Authenticate your Search request with an Authorization: Bearer header.
Output:
Tested Oct 22, 2026 · Python 3 · requests. Without TAVILY_API_KEY set, the snippet stops and prints the message shown above.
Tavily API key at a glance
Item | What developers need to know |
|---|---|
Base URL | |
Authentication |
|
Search response | JSON, with |
Development-key rate limit | Generally 100 requests per minute; endpoint exceptions apply |
Production-key rate limit | Generally 1,000 requests per minute; endpoint exceptions apply (rate limits) |
Search result cap | Up to 20 websites per call, not a guaranteed result count |
Freshness | Described as "Real-time web access", with no fixed refresh interval specified |
License and terms | Tavily’s Platform Terms, not an unrestricted open-data license (Platform Terms) |
Batch retrieval | Extract accepts up to 20 URLs per request |
How to get and store your Tavily API key
Use the + control in the dashboard, name the key, choose Development or Production, and optionally set a monthly usage limit (key setup). Store it as TAVILY_API_KEY on your backend, not in browser code or repositories.
Install the HTTP client with python -m pip install requests. For local setup, use export TAVILY_API_KEY="YOUR_REAL_KEY" in bash or zsh, then launch Python from that session. In deployment, use your backend’s secret settings.

Is a Tavily API key free? Pricing and credits
Yes: Tavily includes 1,000 free API credits each month without requiring a credit card. Pay-as-you-go usage costs $0.008 per credit (pricing).
Prices checked October 22, 2026.
Plan | Price and allowance |
|---|---|
Researcher | Free; 1,000 credits monthly; no credit card required |
Pay as you go | $0.008 per credit |
Project | $30 monthly for 4,000 credits |
Bootstrap | $100 monthly for 15,000 credits |
Startup | $220 monthly for 38,000 credits |
Growth | $500 monthly for 100,000 credits |
Enterprise | Custom pricing |
Credits are not requests. Basic Search costs 1 credit per request; Advanced Search costs 2. Basic Extract costs 1 credit per 5 successful URL extractions, with failed extractions not charged (credit costs).
Set search_depth explicitly to control cost rather than letting automatic parameter selection choose a more expensive search. Credits reset on the first day of each calendar month, which can differ from your subscription billing date.
Tavily rate limits and common errors
Beyond the general key limits above, Usage allows 10 requests per 10 minutes, Crawl allows 100 per minute, and Research task creation allows 20 per minute.
Inspect usage without polling after every search
GET /usage returns key and account usage details. Use it as a diagnostic, not after every search. For HTTP 429 responses, wait for Retry-After when supplied; this example otherwise uses exponential backoff.
Output:
Fix the cause, not just the failed request
Symptom | Cause | Fix |
|---|---|---|
| Missing or invalid API key | Check the credential and Bearer header; do not blindly retry (HTTP errors). |
| Request-rate throttling | Wait for |
| Plan usage limit exceeded | Review account usage and allowance; a short retry delay does not fix this. |
| Pay-as-you-go limit exceeded | Review the limit and increase it in the dashboard if appropriate. |
Key stops authenticating after deletion | Deleted keys are unusable | Update dependent applications with the replacement credential. |
Extract returns HTTP 200 but no usable content | Extraction can fail despite transport success | Inspect |
Search results and extraction in Python
Search returns title, url, content, and score. The score measures relevance, not factual correctness or study quality. Keep these distinctions in your data handling:
- Generated answers:
include_answerrequests an answer generated by an LLM, not a verbatim excerpt. - Page content:
include_raw_content=truerequests extracted page content alongside results. Alternatively, search first and extract selected URLs. - Pagination: the documented schema exposes
max_results, but nopage,offset, orcursor. Do not invent pagination parameters. - Dates:
published_datecan be an estimated publication or last-update date, or null.include_published_dateis beta. - Query length: queries under 1,500 characters are recommended, not an established hard validation boundary.
- Domain filtering: the Python reference documents up to 300
include_domainsentries and 150exclude_domainsentries.
Extract a selected page and inspect failures
Use POST /extract for selected URLs. HTTP 200 can contain an empty results array, so inspect both response arrays rather than assuming the batch succeeded.
Output:
Python libraries
tavily-python is the official Python SDK, with TavilyClient as its documented client (Python quick start). These examples use requests to keep authentication and error handling visible.
Library or tool | Install command | When to use it |
|---|---|---|
|
| Official Python client |
|
| LangChain integration, configured with |
|
| Official JavaScript and TypeScript SDK |
|
| Official CLI, including capped keyless Search and Extract |
The CLI’s keyless mode is separate from authenticated REST access. Use a dashboard-issued key for this guide’s HTTP examples.
Tavily alternatives
Web retrieval APIs
Alternative | Strength | Pricing and access |
|---|---|---|
Exa | Web search, content retrieval, and research | $10 monthly free credits plus a $10 onboarding bonus without a payment method. Lite Search starts at $4 per 1,000 requests with up to 10 results; additional results and AI summaries have separate charges (pricing). |
Firecrawl | Scraping, crawling, and web search | 1,000 free credits monthly. Hobby includes 5,000 monthly credits for $19 with monthly billing, or $16 per month billed annually. Search and scraping consume credits differently (pricing). |
Scholarly data
OpenAlex is a scholarly-data complement, not an arbitrary-web scraper. A free account includes an API key and $1 of daily usage, resetting at midnight UTC; additional prepaid usage is available. Its data is free, but API serving beyond the allowance is charged (OpenAlex access and pricing).
Terms and compliance
- Keep credentials private. Tavily warns against exposing keys in browsers, mobile apps, or public repositories. Its terms restrict transferring or sharing the API, including an Agent Key, without prior written consent, distinct from permitted application integration.
- Verify generated output. The terms require independently verifying accuracy before relying on AI-generated output, including publication or distribution.
- Check content rights. API access does not grant unrestricted rights to retrieved pages. The AUP prohibits violations of privacy, publicity, confidentiality, or intellectual property rights.
- Respect automated-access restrictions. The AUP restricts scraping, harvesting, and indexing the Services or content made available through them, except as expressly permitted by the Services or in writing by Tavily.
Grounding an agent in papers, not web pages: the SciSpace API
Tavily Search returns web results: a title, URL, page content and a relevance score. For a research agent, that leaves gaps. The score measures relevance, not study quality, and results aren't paper records with DOIs, journals or study types. Screening papers, extracting their findings and exporting references is left to you. Tavily's separate Research API can produce cited, structured answers, but its sources are still the web.

The SciSpace API puts the full SciSpace Agent behind one call. It searches, reads, analyses and writes, and delivers the result as ready-to-use files. It comes as two APIs:
API | What you send | What you get back |
|---|---|---|
Search API | A research question in plain language | A list of papers, each with all its relevant metadata, from SciSpace's 280M+ paper index, Google Scholar, PubMed and arXiv |
Task API | Any research task: a literature review, a systematic review, an extraction table, a report, a deck | Links to every file the agent created, plus any supporting text answer. The plan and progress stream live while it runs |
What it adds for agent builders
- Paper records your agent can cite. The Search API returns papers with all their relevant metadata, so your agent cites a real paper rather than whichever web page mentioned it.
- Whole research tasks in one call. Instead of chaining search, extraction and summarization steps yourself, hand the Task API the task. It plans the steps, then searches, reads and writes.
- Sources beyond the web. One task can search 11 national and regional clinical-trial registries plus the WHO registry, Google Patents, grant databases and 77 public science databases such as PubChem and UniProt.
- Finished files. One run can return a Word report, a LaTeX PDF with its BibTeX, a PowerPoint deck or plots. You get links to every file it created.
- Progress your users can see. The Task API streams each plan step and the answer as it's written, and takes follow-ups in the same thread.
What it doesn't do
- Not a web search API. For news, documentation or general web pages, use Tavily or another web retrieval API.
- No paywalled papers. SciSpace reads your own PDFs plus 50M+ open-access full texts.
The SciSpace API is in early access; it isn't open yet. At launch it's open to anyone: register on SciSpace and start, with no sales call. Every account gets $5 in free API credits, enough to try both APIs on real questions. The API is separate from SciSpace consumer plans; no consumer plan includes API usage.
Frequently asked questions
Are credits the same as search requests?
No. Basic and advanced searches have different credit costs, while extraction is billed by successful URL extractions.
How do I revoke a key?
Use the trashcan icon beside the key on the platform’s home page. Deleted keys stop working, so update dependent applications when rotating credentials.
Next guides
Last checked
Facts, prices and code examples in this guide were checked on October 22, 2026.
Sources
- Tavily: How can I create an API key?
- Tavily Search API reference
- Tavily Platform Terms
- Tavily pricing
- Tavily API credits
- Tavily API rate limits
- Tavily: Understanding HTTP errors
- Tavily Python SDK quick start
- Tavily Acceptable Use Policy
注意转载授权 · 阅读原文
来源:SciSpace · scispace.com
引用原文
SciSpace. Tavily API Key: Python Setup, Pricing and Rate Limits[EB/OL]. (2026-10-25)[访问日期]. https://scispace.com/guides/tavily-api-key.