[Integrations](https://spiral.ai/integrations) › [Claude Code](https://spiral.ai/integrations/claude-code) › [Exa](https://spiral.ai/integrations/claude-code/exa)

# How to Use Exa in Claude Code

Exa brings cited web answers and readable page content into Claude Code through Spiral. Use it to check documentation, investigate an unfamiliar API, or gather evidence before changing code.

|  |  |
| --- | --- |
| Tools | 5 |
| Categories | Web |
| Served by | Exa |
| Pricing | Pay per run, no subscription |
| Setup | About 2 minutes, no API key |

## Prompts to try with Exa in Claude Code

- Read package.json and the lockfile. Use Exa Answer to investigate migration requirements for our installed Next.js version to the current stable release. Return an outputSchema with targetVersion, breakingChanges, and verificationSteps. Check the cited documentation against our source files, then write docs/next-migration.md with affected paths and source links.
- Find the Stripe documentation URLs referenced in this repository. Use Exa Contents with those urls, text enabled, and maxAgeHours: 0. Compare the documented webhook verification procedure with our handler, then propose a patch and tests for any mismatch. Include the source URLs in your explanation.
- Use Exa Answer to research cursor pagination patterns for a REST API. Compare the cited recommendations with this project's list endpoints, explain the tradeoffs for our data model, and draft a proposal in docs/pagination.md. Keep sourced recommendations separate from your design choices.
- Read the external documentation links in README.md. Use Exa Contents to retrieve summaries and highlights, then flag instructions that conflict with our dependency versions or configuration. Write a review with file paths, supporting passages, and source URLs.
- Search the web with Exa for the newest papers on small language models and cite each source. Save the result in ./assets.

## How to set up Exa in Claude Code

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the hosted server**: This adds Spiral to the current project. Add `--scope user` to use it in every project.

```bash
claude mcp add --transport http spiral https://api.spiral.ai/mcp
```

2. **Sign in**: Start `claude`, type `/mcp`, choose spiral and Authenticate. Sign in to Spiral in the browser and click Authorize. No API key.

### Use the Spiral skill

1. **Send Claude Code this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Exa**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "exa",
    "model": "exa/answer",
    "input": {
      "query": "<query>"
    }
  }'
```

Then paste one of the prompts above: Claude Code finds Exa on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/claude-code

## Exa tools and prices

- [Exa Answer · Cited Answers](https://spiral.ai/tools/exa/exa/answer) (Exa): $0.0065 per answer.
- [Exa Contents · Web Page Content](https://spiral.ai/tools/exa/exa/contents) (Exa): $0.0013 per page for each content type (text, highlights, summary), subpages included.
- [Exa Find Similar · Similar Pages](https://spiral.ai/tools/exa/exa/findSimilar) (Exa): $0.0052 per search with 10 results. Each result after 10: $0.0013. Summaries: $0.0013 per result.

## What can you do with Exa in Claude Code?

Tie web research to the project: ask Claude Code to compare retrieved documentation with installed dependencies and the files that use them. Request a migration plan, a focused patch, or a research file with source links.

### Plan a dependency migration

Compare cited migration guidance with the versions and API calls in your repository. Ask for an affected-file list and verification steps before requesting edits.

### Check an API implementation

Retrieve the documentation URLs relevant to a handler or client. Compare the documented requirements with the implementation and request tests for specific differences.

### Document an architecture decision

Gather web evidence for a design question, then ask Claude Code to relate it to your project's constraints. Save the reasoning and source links alongside the code.

### Review documentation references

Fetch pages linked from the README and compare their instructions with the repository. Turn discrepancies into concrete documentation edits.

### Investigate an unfamiliar dependency

Ask a focused question about the dependency, inspect the cited sources, and trace the relevant behavior through your project's call sites.

### Prepare a reviewable implementation plan

Combine retrieved documentation with local file references to produce a plan that explains each proposed change and the evidence behind it.

## Overview

- [Exa](https://spiral.ai/providers/exa)
- [All Claude Code guides](https://spiral.ai/integrations/claude-code)

## Exa in other agents

- [Amp](https://spiral.ai/integrations/amp/exa)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/exa)
- [Claude](https://spiral.ai/integrations/claude-desktop/exa)
- [Cline](https://spiral.ai/integrations/cline/exa)
- [Codex](https://spiral.ai/integrations/codex/exa)
- [Cursor](https://spiral.ai/integrations/cursor/exa)
- [Devin](https://spiral.ai/integrations/devin/exa)
- [dots](https://spiral.ai/integrations/dots/exa)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/exa)
- [Gemini](https://spiral.ai/integrations/gemini/exa)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/exa)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/exa)
- [goose](https://spiral.ai/integrations/goose/exa)
- [Grok](https://spiral.ai/integrations/grok/exa)
- [Grok Build](https://spiral.ai/integrations/grok-build/exa)
- [Hermes](https://spiral.ai/integrations/hermes/exa)
- [Instinct](https://spiral.ai/integrations/instinct/exa)
- [Manus](https://spiral.ai/integrations/manus/exa)
- [Muse](https://spiral.ai/integrations/muse/exa)
- [Muse Code](https://spiral.ai/integrations/muse-code/exa)
- [n8n](https://spiral.ai/integrations/n8n/exa)
- [Notion](https://spiral.ai/integrations/notion/exa)
- [OpenClaw](https://spiral.ai/integrations/openclaw/exa)
- [opencode](https://spiral.ai/integrations/opencode/exa)
- [Perplexity](https://spiral.ai/integrations/perplexity/exa)
- [Raycast](https://spiral.ai/integrations/raycast/exa)
- [VS Code](https://spiral.ai/integrations/vscode/exa)
- [Windsurf](https://spiral.ai/integrations/windsurf/exa)
- [Zapier](https://spiral.ai/integrations/zapier/exa)

## More Claude Code guides

- [Alexandria](https://spiral.ai/integrations/claude-code/alexandria)
- [Firecrawl](https://spiral.ai/integrations/claude-code/firecrawl)
- [Wikipedia structured article](https://spiral.ai/integrations/claude-code/wikipedia-structured-article)
- [ScrapeCreators](https://spiral.ai/integrations/claude-code/scrapecreators)
- [Wikipedia language codes](https://spiral.ai/integrations/claude-code/wikipedia-language-codes)
- [TikHub](https://spiral.ai/integrations/claude-code/tikhub)

## Questions about Exa in Claude Code

**Can Claude Code use Exa?**

Yes. Add Spiral to Claude Code as an MCP server, and Claude Code can find and run Exa like any built-in tool.

**How much does Exa cost in Claude Code?**

Each tool has its own price, for example Exa Answer Cited Answers: $0.0065 per answer; Exa Contents Web Page Content: $0.0013 per page for each content type (text, highlights, summary), subpages included; Exa Find Similar Similar Pages: $0.0052 per search with 10 results. Each result after 10: $0.0013. Summaries: $0.0013 per result. You pay per run from one Spiral balance, and failed runs are free.

**Do I need an Exa account to use Exa in Claude Code?**

No. Spiral runs Exa on its own Exa account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Exa in Claude Code?**

About two minutes: add the hosted server, then sign in.

**Does Claude Code wait while Exa runs?**

Exa runs in the background. Claude Code starts the run, checks on it and gives you the json when it's ready.

**Does Exa return sources with its answers?**

Yes. Exa Answer returns the generated answer and the sources used to create it. Ask Claude Code to retain those links in its explanation or research file.

**Can Exa return structured JSON in Claude Code?**

Yes. Exa Answer accepts outputSchema to return an answer matching your schema. Specify the structure you need, such as breaking changes and verification steps.

**Can Exa read documentation URLs I already have?**

Yes. Exa Contents accepts URLs and can return text, highlights, or summaries. Include the links in your request or ask Claude Code to collect them from the project.

**How do I request fresh page content from Exa?**

Set maxAgeHours: 0 on a Contents request to request live content fetched within the last 60 seconds. A failed fetch may return the latest cached copy, so check retrieval results when freshness matters.

**When should I use Exa Answer versus Contents?**

Use Answer for a question that needs a generated response with sources. Use Contents when you already have URLs and want their text, highlights, or summaries.

