Index of every page on this site: llms.txt
All skills
exa-labs avatar

/build-with-exa

@9d220cc
by Exa Labsexa-labs/agent-skills75 stars
8
Run it yourself

Build applications and agents with Exa's API: search, contents extraction, answer, Agent API, monitors, websets, OpenAI-compatible endpoints, and exa-py/exa-js SDKs. Use when choosing Exa endpoints, writing Exa API calls, integrating semantic web search or research into products, or debugging Exa request shapes.

Use this Skill: https://skilld.dev/gh/exa-labs/agent-skills/build-with-exa

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesopenai-compat.md

≈894 tokens on demand. Your agent reads this file only when SKILL.md points to it.

OpenAI-Compatible Endpoints Reference

Compatibility layer for OpenAI SDK clients.

Canonical Docs Links

  • Base docs URL: https://exa.ai/docs
  • OpenAI SDK compatibility: /integrations/openai-sdk
  • Agent via the Responses API: /integrations/openai-sdk#agent-via-responses-api
  • Agent API: /agent/quickstart

Overview

Exa exposes OpenAI-compatible endpoints so existing OpenAI SDK clients can route requests to Exa with minimal call-site changes.

This is useful when:

  • you already depend on the OpenAI SDK
  • you want a compatibility-first migration path
  • you need drop-in chat or responses interfaces

For new Exa-first integrations, prefer native Exa endpoints because the request shapes are clearer and expose Exa-specific semantics directly.

Not the Same as Tool Calling

These compatibility endpoints replace your LLM provider with Exa: you point the OpenAI SDK at https://api.exa.ai and Exa runs the answer or research itself.

If you instead want to keep your current agent and have it call Exa as one of its tools, see the tool calling pattern in prompting-and-patterns.md.

Endpoint Mapping

Exa Endpoint OpenAI Interface Models Primary Route
/chat/completions Chat Completions API exa Routes to /answer
/responses Responses API exa-agent Routes to the Agent API

Exa's compatibility layer parses the conversation and forwards the last message into its underlying Exa route.

Basic Setup

Python:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.exa.ai",
    api_key="YOUR_EXA_API_KEY"
)

TypeScript:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.exa.ai",
  apiKey: process.env.EXA_API_KEY
});

/chat/completions for Answer-Like Flows

Use model exa when you want compatibility access to Exa's grounded answer behavior.

completion = client.chat.completions.create(
    model="exa",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What are the latest developments in quantum computing?"}
    ],
    extra_body={"text": True}
)

print(completion.choices[0].message.content)

Use extra_body to pass Exa-specific fields such as text.

/responses for Agent Runs

Use model exa-agent to run Exa Agent (multi-step research, enrichment, list-building) through the OpenAI Responses interface. Pick an execution mode:

  • Default: the request blocks and returns the completed response.
  • stream: true: streams Responses events over SSE, ending with response.completed.
  • background: true: returns an in_progress response at once. Poll GET /responses/{id} for the result.

Set reasoning.effort to trade cost against depth. high, xhigh, and ultra runs return 400 unless you set stream or background. Continue a completed run with previous_response_id.

response = client.responses.create(
    model="exa-agent",
    input="Find the top 5 AI startups founded in 2025 with their funding amounts",
    reasoning={"effort": "medium"},
)

print(response.output_text)

Critical Pitfalls

  1. OpenAI-compatible endpoints are secondary to native Exa endpoints for new integrations.
  2. Remember to use extra_body for Exa-specific fields on OpenAI SDK clients.
  3. The compatibility layer forwards the last message; do not assume it preserves every native Exa feature in the same shape as the direct endpoints.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2d3 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    The skill provides official documentation and SDK guidance for the Exa API. It includes instructions for installing and using official Python and TypeScript libraries and provides best practices for semantic search and AI research workflows.

  • Socket2d

    No alerts

  • Snyk3d

    Risk: MEDIUM · 1 issue

Signed by skilld at 9d220cc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 5 days ago
metadata
{
  "author": "Exa",
  "version": "0.3.0",
  "docs": "https://exa.ai/docs"
}

README badge

README badge for exa-labs/agent-skills/build-with-exa