Skip to content

feat(exa): add x-exa-integration header for usage attribution#4385

Open
tgonzalezc5 wants to merge 1 commit intosimstudioai:mainfrom
tgonzalezc5:add-exa-integration-header
Open

feat(exa): add x-exa-integration header for usage attribution#4385
tgonzalezc5 wants to merge 1 commit intosimstudioai:mainfrom
tgonzalezc5:add-exa-integration-header

Conversation

@tgonzalezc5
Copy link
Copy Markdown

Summary

Adds an x-exa-integration: sim header to every request the Exa tools send to api.exa.ai. This is a request header Exa uses on their side to attribute API traffic to the integration that originated it; it has no effect on the response or on user-facing behavior.

Updated:

  • apps/sim/tools/exa/search.ts
  • apps/sim/tools/exa/get_contents.ts
  • apps/sim/tools/exa/find_similar_links.ts
  • apps/sim/tools/exa/answer.ts
  • apps/sim/tools/exa/research.ts (both the create-task POST and the polling GET)

Example

headers: (params) => ({
  'Content-Type': 'application/json',
  'x-api-key': params.apiKey,
  'x-exa-integration': 'sim',
}),

Test plan

  • grep -n "x-exa-integration" apps/sim/tools/exa/*.ts shows the header set in all 6 request sites (5 tools, plus the research polling fetch)
  • Existing Exa tool tests still pass (no behavioral change to params/response handling)

Sets x-exa-integration: sim on all Exa API requests so Exa can attribute
usage to this integration on their side.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 1, 2026 9:07pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 1, 2026

PR Summary

Low Risk
Low risk: this only adds a static request header to Exa API calls and does not change request bodies or response handling; the main risk is if Exa rejects unknown headers, which is unlikely.

Overview
Adds the x-exa-integration: sim header to all Exa tool HTTP requests (search, answer, get_contents, find_similar_links, and research, including the research polling GET) so Exa can attribute API usage to this integration.

Reviewed by Cursor Bugbot for commit 39c9286. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 1, 2026

Greptile Summary

This PR adds 'x-exa-integration': 'sim' as a static attribution header to all outbound requests made by the five Exa tools (search, answer, get_contents, find_similar_links, research). The header is purely informational on Exa's side and has no effect on request/response semantics. Coverage is complete — the research tool correctly adds it to both the initial task-creation POST and the polling GET inside postProcess.

Confidence Score: 5/5

Safe to merge — additive-only change with no behavioral impact on request/response handling.

All five tool files are updated consistently and the header value is a hardcoded, non-sensitive string. The research polling path is also covered. No logic, type, or security concerns.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/tools/exa/search.ts Adds x-exa-integration: sim header to the search tool's request headers — correct and complete.
apps/sim/tools/exa/answer.ts Adds x-exa-integration: sim header to the answer tool's request headers — correct and complete.
apps/sim/tools/exa/find_similar_links.ts Adds x-exa-integration: sim header to the find-similar-links tool's request headers — correct and complete.
apps/sim/tools/exa/get_contents.ts Adds x-exa-integration: sim header to the get-contents tool's request headers — correct and complete.
apps/sim/tools/exa/research.ts Adds x-exa-integration: sim to both the task-creation POST (via headers config) and the polling GET inside postProcess — both call sites correctly covered.

Sequence Diagram

sequenceDiagram
    participant Client as Sim Workflow
    participant Tool as Exa Tool
    participant Exa as api.exa.ai

    Client->>Tool: execute(params)
    Tool->>Exa: POST /endpoint (x-exa-integration: sim added)
    Exa-->>Tool: response
    alt research tool polling
        loop until complete
            Tool->>Exa: GET /research/v1/taskId (x-exa-integration: sim added)
            Exa-->>Tool: task status
        end
    end
    Tool-->>Client: processed result
Loading

Reviews (1): Last reviewed commit: "feat(exa): add x-exa-integration header ..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant