Skip to main content
POST
cURL
Relace Search is the model behind Fast Agentic Search. It explores a codebase in 4-5 turns of parallel tool calls and reports back the relevant files with line ranges. This endpoint runs the model one turn at a time. You own the agent loop: send the conversation so far, execute the tool calls it returns against your codebase, append the results, and call again until it calls report_back.
If your code lives in a Relace Repo, use the Fast Agentic Search endpoint instead. It runs the full loop on our infrastructure and streams the result back.

Models

OpenAI SDK

Point an OpenAI client at the /v1/search base URL. The model is also reachable as relace-search on the shared /v1/chat/completions route.
The model is trained against the exact system prompt, user prompt template, and tool schemas in the agent harness guide. Deviating from them degrades search quality.

Authorizations

Authorization
string
header
required

Relace API key Authorization header using the Bearer scheme.

Body

application/json

OpenAI-compatible chat completions request with the Fast Agentic Search tool definitions

OpenAI-compatible request for one turn of the search agent. Fields outside this list are ignored.

model
string
required

Must be relace-search. This route serves only the Fast Agentic Search model.

messages
object[]
required

The agent conversation so far, as OpenAI-format message objects: the system prompt, the user prompt, and any previous assistant tool calls with their tool results.

tools
object[]

OpenAI-format function tool definitions. Use the exact view_file, view_directory, grep_search, bash, and report_back schemas from the agent harness guide; the model is trained against them.

tool_choice
any

Controls tool use: none, auto, required, or a specific tool. Use auto.

stream
boolean

If true, tokens are sent as server-sent events as they are generated. Token usage is always reported in the final chunk of the stream.

max_tokens
integer

Maximum number of tokens to generate for this turn.

stop
string[]

Sequences at which generation stops.

seed
integer

Seed for deterministic sampling where supported.

Response

Chat completion generated

id
string

Unique identifier for the completion

object
string

Always chat.completion

created
integer

Unix timestamp of when the completion was created

model
string

The model that served the request

choices
object[]

The generated completions

usage
object

Token usage information for the request