# Relevan > Relevan is a search relevance platform: index a product/content catalog into schema-aware search indexes and query it through a versioned HTTP API built to be used by human developers and LLM agents alike. Relevan's API is documented as an OpenAPI 3.1 document generated directly from the live route definitions, so it is always in sync with what is deployed. All `/v1` and `/v1-beta` routes require either an org-scoped API key (`x-api-key` header) or a console session cookie. The hosted MCP server at `/v1/mcp` takes an OAuth access token in place of a key. ## API Reference - [OpenAPI spec](https://capy-learning-loop-demo.api.dev.relevan.dev/openapi): Machine-readable OpenAPI 3.1 document covering every endpoint, request/response schema, and the `ApiKeyAuth` security scheme. Start here to generate a client or teach an agent the API surface. - [Interactive API docs](https://capy-learning-loop-demo.api.dev.relevan.dev/docs): Human-browsable reference (Scalar) rendered from the same spec. ## Capabilities - Organizations: `GET /v1/organizations` resolves the caller's `x-api-key` (or session cookie) to the organization(s) it can access. An org-scoped API key always resolves to exactly one — call this first to get the `orgId` (either the returned `id` or `slug` works) used by every `/v1/{orgId}/...` route below. - Indexes: create, update, list, and delete search indexes scoped to your organization. - Mappings: define and deploy the schema (fields, types, analyzers) an index uses to interpret documents. - Mapping proposal: the `relevan-mapping` skill below explains how to draft and deploy a `RelevanMapping` from a sample of documents. - Documents: create, update, list, and bulk-ingest the documents inside an index. - Search: query an index and get back a rich, LLM-oriented result shape — the same response shape whether the caller is a direct API consumer or an agent. Each response's `searchContext` carries a `queryId`; keep it, and send it back on a feedback call. - Filter values: `POST /v1/{orgId}/indexes/{indexName}/filter-values` returns the most common values of the filterable fields of an index, with a document count for each value. Send `filters` to count inside them: `count` is the number of documents that match every filter. `complete` is false when the `size` limit left out values. A number or date field returns its `min` and `max` in `ranges`. Call it before you set a `filters` value in a search: a value that is not in the data returns 0 hits. - Per-index skill doc: `GET /v1/{orgId}/indexes/{indexName}/skill` returns a Markdown doc, generated from that index's live mapping, explaining its fields and how to query it — fetch this once per index before searching it as an agent. - Feedback (beta): `POST /v1-beta/{orgId}/indexes/{indexName}/feedback` reports what happened after a search — a click, an agent's own relevance judgment, or a closing event such as a purchase or a hire. Send it every time you act on a search result. An agent sends exactly one `search_judgment` for each search, with a `description` of what the user wanted. On the Small Business plan and above, Relevan trains a ranking model for each index from its feedback, in an offline job. On the Growth plan and above, that model reorders the top results of each search, once it beats the current ranking offline. - MCP: the same API as MCP tools. The read tools are `list_indexes`, `describe_index`, `search`, `get_filter_values`, `get_document`, `send_search_feedback`. The write tools are `create_index`, `create_mapping`, `upsert_documents`, `delete_document`. A tool call gets the same permission check, rate limit, and search quota as the REST call. The next section gives the URLs. ## Connect an agent - Hosted MCP server: `https://capy-learning-loop-demo.api.dev.relevan.dev/v1/mcp` (Streamable HTTP). It uses OAuth, so the user needs no API key. The client registers with a Client ID Metadata Document or with dynamic client registration. The user signs in to the Relevan console, picks the organization, and approves the access. `read` gives the tools that search, read documents, and send feedback. `write` also gives the tools that create indexes and load documents, and only an organization owner can approve it. - MCP with an API key: `https://capy-learning-loop-demo.api.dev.relevan.dev/v1/{orgId}/mcp`. Send the key as `Authorization: Bearer `. A read key gets the read tools, and a write key also gets the write tools. - Claude, ChatGPT, and other MCP clients: add `https://capy-learning-loop-demo.api.dev.relevan.dev/v1/mcp` as a custom connector or a remote MCP server. The steps for each client: https://capy-learning-loop-demo.docs.dev.relevan.dev/guides/mcp-server - Claude Code, Codex, and GitHub Copilot CLI: the Relevan agent plugin adds the MCP server and the skills. In Claude Code, run `claude plugin marketplace add relevan-dev/agent-plugins`, then `claude plugin install relevan@relevan`, then run `/mcp` in a new session to sign in. The commands for each agent: https://github.com/relevan-dev/agent-plugins - Python: `pip install relevan`. `Client()` reads the API key from `RELEVAN_API_KEY`. https://github.com/relevan-dev/relevan-python - The first upload and the first search, with an agent or with the API: https://capy-learning-loop-demo.docs.dev.relevan.dev/guides/get-your-data-in ## Skills Each skill is a Markdown file for one task. Fetch the skill for your task, or save each file as `//SKILL.md` to install it. - [relevan-setup](https://capy-learning-loop-demo.api.dev.relevan.dev/skills/relevan-setup/SKILL.md): Set up Relevan search from the start: authenticate, create an index, load documents, run the first search, and send the first feedback. Use when a user asks you to add Relevan search to a product. - [relevan-ranking-signals](https://capy-learning-loop-demo.api.dev.relevan.dev/skills/relevan-ranking-signals/SKILL.md): Find the data that tells Relevan which result is the best one, such as prices, sales, or activity, and add it to each document. Use before you design a Relevan mapping. - [relevan-mapping](https://capy-learning-loop-demo.api.dev.relevan.dev/skills/relevan-mapping/SKILL.md): Draft and deploy a RelevanMapping from a sample of documents. Use when a Relevan index has no mapping, or when the documents get new fields. - [relevan-feedback](https://capy-learning-loop-demo.api.dev.relevan.dev/skills/relevan-feedback/SKILL.md): Send search_judgment, click, conversion, and llm_judgment feedback to Relevan after a search. Relevan trains the ranking of the index from it. Use when you build search into an app, or when an agent acts on a search result. Start with `relevan-setup`. It links the other skills at the step that needs them. ## Plans | Plan (`tier`) | Price per month | Search requests per minute | Searches per month | Storage | |---|---|---|---|---| | Free (`starter`) | $0 | 60 | 10,000 | 100 MiB | | Hobby (`hobby`) | $20 | 120 | 50,000 | 300 MiB | | Small Business (`business`) | $79 | 600 | 250,000 | 1 GiB | | Growth (`growth`) | $299 | 1,500 | 1,000,000 | 2 GiB | An Enterprise organization gets contracted limits. `GET /v1/{orgId}/usage` returns the `tier` of the organization. Prices and features: https://capy-learning-loop-demo.dev.relevan.dev/pricing ## Notes - Requests are versioned under `/v1` and `/v1-beta`. `/v1` is stable; a change ships as a new version rather than in place. `/v1-beta` holds new capabilities whose contract may still change before it moves to `/v1`. - Errors return a consistent JSON shape (`ErrorResponse` in the OpenAPI spec: `message` plus an optional `error` detail) rather than ad hoc formats per route. - Rate limits: the free tier allows 60 search requests per minute for each organization. The plan table gives the limit of each plan. A request over this limit gets a 429 response with a `Retry-After` header. - Monthly search quota: the free tier allows 10,000 searches per calendar month (UTC) for each organization. When the organization has a monthly cap, each search response has the `X-Search-Quota-Limit`, `X-Search-Quota-Remaining`, and `X-Search-Quota-Reset` headers. Read them after your first search, and plan your work so that you do not use all the searches. An organization with no monthly cap gets no quota headers. Each search response also has the `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` headers for the per-minute limit. A search over the quota gets a 402 response with `code: "search_quota_exceeded"` and a `Retry-After` header that gives the seconds until the quota resets. Do not retry a 402 before that time. A search that fails does not count. - Storage cap: each organization has a cap on the document content of all its indexes. The cap depends on the plan: Free (`starter`): 100 MiB, Hobby (`hobby`): 300 MiB, Small Business (`business`): 1 GiB, Growth (`growth`): 2 GiB. An Enterprise (`enterprise`) organization has a contracted cap. Before a large upload, call `GET /v1/{orgId}/usage`. It returns `tier`, `storage.limitBytes`, `storage.usedBytes`, and `storage.remainingBytes`. A `null` cap means no cap. Then estimate the size of the corpus: the JSON text of the `content` of each document, added together, plus 20%. Relevan stores `content` as Postgres jsonb text, which has a space after each `:` and `,`. A document that replaces one with the same id counts only the change in size. If the corpus can be larger than `storage.remainingBytes`, tell the user before you start the upload. Also tell the user that a higher plan raises the cap, on the billing page: https://capy-learning-loop-demo.console.dev.relevan.dev/{orgId}/billing. An upload over the cap gets a 402 response with `code: "storage_limit_exceeded"`. The body gives `limitBytes`, `usedBytes`, `incomingBytes`, and `remainingBytes`. Relevan writes no documents from that request, and the earlier requests of the upload stay written. Do not retry it. Tell the user to delete documents or to upgrade the plan on the billing page. ## Other Relevan documents - [Relevan overview](https://capy-learning-loop-demo.dev.relevan.dev/llms.txt): What Relevan is, who it suits, and what it costs. - [Documentation index](https://capy-learning-loop-demo.docs.dev.relevan.dev/llms.txt): Each page of the Relevan documentation: guides, releases, and resources.