Skip to main content

OpenAI-Compatible Endpoints Reference

Compatibility layer for OpenAI SDK clients.
  • Base docs URL: https://exa.ai/docs
  • OpenAI SDK compatibility: /reference/openai-sdk
  • OpenAI Responses API with Exa: /reference/openai-responses-api-with-exa

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 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’s compatibility layer parses the conversation and forwards the last message into its underlying Exa route.

Basic Setup

Python:
TypeScript:

/chat/completions for Answer-Like Flows

Use model exa when you want compatibility access to Exa’s grounded answer behavior.
Use extra_body to pass Exa-specific fields such as text.

/responses for the Agent API

The /responses endpoint routes to the Agent API in the OpenAI Responses API shape. See the Agent API reference for supported models.

Model Routing Guidance

  • exa: chat-completions compatibility for answer-like flows
Treat these as compatibility-layer model names, not as replacements for learning Exa’s native endpoint semantics.

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.
Last modified on July 22, 2026