Budibase/budibase · error

Exa error: ${response.status} ${response.statusText} - ${err

Error message

Exa error: ${response.status} ${response.statusText} - ${errorBody}

What it means

createExaTool's fetch wrapper throws this when the Exa search API responds with a non-OK HTTP status, embedding the status, statusText and raw error body. It surfaces upstream Exa API failures to the agent as tool errors.

Source

Thrown at packages/server/src/ai/tools/search/exa.ts:45

  tool: tool({
    description: "Search the web using Exa",
    inputSchema: exaSearchParams,
    execute: async args => {
      const response = await fetch("https://api.exa.ai/search", {
        method: "POST",
        headers: {
          Authorization: `Bearer ${apiKey}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          query: args.query,
          num_results: args.num_results,
        }),
      })

      if (!response.ok) {
        const errorBody = await response.text()
        throw new Error(
          `Exa error: ${response.status} ${response.statusText} - ${errorBody}`
        )
      }
      return response.json()
    },
  }),
})

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Verify the Exa API key is set and valid
  2. Inspect the error body for the exact API error and fix request parameters
  3. Implement backoff/retry for 429/5xx responses
  4. Check Exa status page for outages

Example fix

// before
throw new Error(`Exa error: ${response.status} ... - {"error":"Invalid API key"}`)
// after
// set correct key before creating tool
process.env.EXA_API_KEY = "<valid key>"
Defensive patterns

Strategy: retry

Validate before calling

if (!process.env.EXA_API_KEY) throw new Error("EXA_API_KEY not configured")

Try / catch

try { await exaTool.run(args) } catch (e) { if (e.message.startsWith("Exa error:")) { const status = parseInt(e.message); if (status === 429 || status >= 500) await retryWithBackoff(); else surfaceToAgent(e) } }

Prevention

When it happens

Trigger: Exa API returns 4xx/5xx — invalid or missing API key (401), bad request params (400), rate limiting (429), or server errors (5xx).

Common situations: Missing/expired EXA_API_KEY; exceeded rate limits; malformed query parameters; Exa outage.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/b328c2f59f701f3f. Report an issue: GitHub.