Loading...
Loading...
Build apps and agents on the Parallel API: Search, Extract, Responses, Task, Decisions and Monitor, through the parallel-web Python and TypeScript SDKs or REST. Use when writing, reviewing or debugging code that calls Parallel; when choosing a Parallel API, search mode, reasoning effort or Task processor; when adding web search, page extraction, cited answers, research, enrichment, web-grounded decisions or web monitoring to an app; when swapping another search provider for Parallel; when setting up PARALLEL_API_KEY; or when a Parallel request fails. Not for searching the web inside the agent's own session. To remove an existing Exa, Tavily, Perplexity or Firecrawl integration end to end, use migrate-to-parallel; to benchmark Parallel against another provider, use parallel-search-evaluation.
npx skill4agent add parallel-web/parallel-agent-skills parallel-apiverified.mdhttps://docs.parallel.ai/llms.txt/v1/v1/search/v1/extract/v1/monitors/v1beta/v1search_queriesmodesearch_queriesmodeadvancedfastfastx-api-keyx-api-keyAuthorization: BearerPARALLEL_API_KEYNEXT_PUBLIC_VITE_EXPO_PUBLIC_proerrorswarnings{"type": "refusal"}[ -n "$PARALLEL_API_KEY" ] && echo "PARALLEL_API_KEY is set"
grep -qs '^PARALLEL_API_KEY=' .env && echo "PARALLEL_API_KEY is in .env"Parallel needs an API key:
1. Sign in or sign up at https://platform.parallel.ai and create a key.
2. Add PARALLEL_API_KEY=<your key> to <file>.
3. Reply done.<file>.env.env.gitignore| Language | Install | Client |
|---|---|---|
| Python | | |
| TypeScript | | |
| Responses, any language | the OpenAI SDK | |
| Other languages | none | REST at |
parallel-webPARALLEL_API_KEY| Need | API | Endpoint | Latency | Price (USD) |
|---|---|---|---|---|
| Ranked pages and excerpts for the app's own model | Search | | 200 ms to 3 s | $1 to $5 / 1k requests |
| Content of known URLs, including PDFs and JS-heavy pages | Extract | | 1 to 20 s | $1 / 1k URLs |
| A cited answer in one synchronous call | Responses | | 5 to 60 s | $10 to $250 / 1k |
| A probability, choice or score about a subject | Decisions | | 200 ms to 1 s | $1 / 1k (up to 100 questions each) |
| Research or enrichment that fills a schema, in the background | Task | | 10 s to 2 h | $5 to $2,400 / 1k runs |
| Alerts on new web events, on a schedule | Monitor | | ongoing | $3 to $10 / 1k executions |
modefastturbobasicadvancedreasoning.effortlowmediumhighprocessorlitebasecoreproprocessorlitebaseadvanced_settings.max_resultsadvanced_settings.excerpt_settings.max_chars_per_resultmodefrom parallel import Parallel
client = Parallel() # reads PARALLEL_API_KEY
objective = "Current enforcement dates for the EU AI Act's general-purpose AI obligations"
search = client.search(
objective=objective,
search_queries=["EU AI Act GPAI enforcement dates", "AI Act obligations timeline"],
mode="fast",
)
# Excerpts often answer the question. Extract only the pages worth reading in full.
extract = client.extract(
urls=[r.url for r in search.results[:3]], # up to 20 URLs per call
objective=objective,
session_id=search.session_id, # reuse one session_id across related calls
)
pages = [(p.url, p.excerpts) for p in extract.results]
failed = [e.url for e in extract.errors] # failed URLs appear only hereimport Parallel from "parallel-web";
const client = new Parallel(); // reads PARALLEL_API_KEY
const search = await client.search({
objective: "Current enforcement dates for the EU AI Act's general-purpose AI obligations",
search_queries: ["EU AI Act GPAI enforcement dates", "AI Act obligations timeline"],
mode: "fast",
});
for (const r of search.results) console.log(r.url, r.excerpts[0]);client.searchmode{
"name": "search_web",
"description": "Search the web and return result titles, URLs, and excerpts.",
"parameters": {
"type": "object",
"properties": {
"objective": { "type": "string", "description": "Describe the search goal in a concise, standalone sentence. Name the key entity or topic." },
"search_queries": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"maxItems": 3,
"description": "Provide 1-3 keyword queries of 3-6 words each. Include the key entity or topic in every query. For multiple queries, vary names, synonyms, or angles. Do not use sentences, instructions, or site: operators."
}
},
"required": ["objective", "search_queries"]
}
}https://docs.parallel.ai/search/best-practices.md#search-tool-definitionimport os
from openai import OpenAI
client = OpenAI(api_key=os.environ["PARALLEL_API_KEY"], base_url="https://api.parallel.ai/v1")
response = client.responses.create(
model="parallel",
input="Which G7 country has the highest corporate tax rate?",
reasoning={"effort": "low"}, # low | medium (default) | high
timeout=120.0,
)
print(response.output_text)url_citationprevious_response_idrun = client.task_run.create(
input={"company_name": "Stripe", "website": "stripe.com"},
task_spec={"output_schema": "The founding year and total funding raised"},
processor="base",
)
result = client.task_run.result(run.run_id, api_timeout=3600) # blocks until done
print(result.output.content)output_schema{"type": "json", "json_schema": {...}}{"type": "text"}output.basisrun_id/eventsresultinputclient.taskRun.create({...})client.taskRun.result(runID, { timeout })import os, requests
response = requests.post(
"https://api.parallel.ai/v1/decisions",
headers={"x-api-key": os.environ["PARALLEL_API_KEY"]},
json={
"state": {"company": "Clay", "website": "https://www.clay.com"},
"questions": {
"has_cli": {"type": "noul", "instructions": "Does Clay offer an official command-line interface (CLI)?"}
},
},
timeout=30,
)
response.raise_for_status()
answer = response.json()["answers"]["has_cli"]
if answer["type"] != "refusal":
probability = answer["noul"] # 0 to 1monitor = client.monitor.create(
type="event_stream",
frequency="1d", # any value from 1h to 30d
processor="lite",
settings={"query": "AI startup funding announcements"},
webhook={"url": "https://example.com/webhooks/parallel", "event_types": ["monitor.event.detected"]},
)client.monitor.cancel(monitor_id)data.event.event_group_idclient.monitor.events(monitor_id, event_group_id=...)migrate-to-parallelsearch_queriesobjectivemodeinstantultra-fastturbofastfastbasicbasicautoadvancedadvanceddeepadvanced_settingsmax_resultssource_policy.include_domainsexclude_domainssource_policy.after_dateYYYY-MM-DDurltitlepublish_dateexcerptshttps://docs.parallel.ai/search/migrate-to-parallel.mdparallel-search-evaluationnpx skills add parallel-web/parallel-agent-skills --skill parallel-search-evaluationhttps://skills.parallel.ai/parallel-search-evaluation/SKILL.mdwebhook-signature| Status | Meaning | Fix |
|---|---|---|
| 401 | Key missing or invalid | Check that the process loaded |
| 402 | Not enough available balance | Credits reserved by running tasks count against it. The user adds funds at |
| 408 | A blocking result call timed out; the run continues | Poll again, or use a webhook or |
| 422 | Request validation failed | Read |
| 429 | Rate limit, over a rolling 60 seconds | Retry with exponential backoff and jitter |
| 5xx | Server error | Retry with backoff; contact |
support@parallel.ai