# OpenAPI spec

> SimilarIQ publishes an OpenAPI spec at https://similariq.ai/openapi.json. It is a machine-readable description of the REST API that tools can read to generate typed clients, import requests into API explorers, validate calls and give AI agents a callable definition of the look-alike search. The only published charge is for the searches you make through the API, at $0.25 each.

Source: https://similariq.ai/features/openapi-spec · Updated 2026-11-25

## What the OpenAPI spec is and the problem it solves

An OpenAPI document describes an HTTP API in a structured format: which paths exist, which methods they accept, what goes in the request and what comes back. People read documentation. Programs read specs. SimilarIQ provides both, with human documentation at [/docs](https://similariq.ai/docs) and the machine-readable file at `/openapi.json`.

The problem a spec solves is transcription. Without one, a developer reads the docs and retypes the endpoint, the header name and the response fields into code. An AI agent has to be told the same things in a prompt. Each retyping is a chance to misspell `matchScore` or forget that the key goes in `X-API-Key`.

With a spec, a tool does the transcription. A generator emits a client with the right method names and types. An API explorer builds the request for you. An agent framework turns an operation into a tool definition. The description is written once, by the people who run the API.

## How it works: what the spec describes

The file lives at one fixed address, `https://similariq.ai/openapi.json`, and it is JSON. Tools that accept an OpenAPI URL can be pointed straight at it. Tools that want a file can be given a saved copy.

The API it describes is small. The core call is `POST https://similariq.ai/api/v1/search` with a body such as `{"domain":"stripe.com","limit":100}` and a key in the `X-API-Key` header or as a bearer token. The response is a ranked list where each result has `rank`, `company`, `domain`, `matchScore`, `type`, `confidence` and `likelyCompetitor`, alongside top-level fields including `searchId` and `creditsRemaining`. There is also `GET https://similariq.ai/api/v1/balance`.

Several details are not published outside the file itself, so this page does not state them: which OpenAPI version the document uses, exactly which of the additional endpoints for history, bulk jobs, saved companies and share links it covers, and how it is versioned when the API changes. Open the file to see. Treat it as the source of truth over anything written about it, including this page.

## A worked example: from spec to working client

A developer on a data team needs to call SimilarIQ from a service written in a language with no official SDK. The official SDKs cover Node and Python. She downloads `openapi.json`, runs an OpenAPI client generator for her language and gets a typed client with a search operation and a model for a result.

She stores an `sk-live-` key as a secret and writes a test. The first call in the test is the balance operation, because it is free and proves that authentication works. The second is one search, which costs one credit, $0.25. She saves that response as a fixture and runs the remaining tests against the fixture, so the suite never spends again.

The total cost of the integration work is $0.25, or nothing if the two free signup searches are available to her key. In production the service runs perhaps 200 searches a month, a hypothetical figure, which is $50. The spec itself contributed no cost and removed the hand-written request code.

## Where the spec fits if you use the web app

The spec is not something you use inside the web app. The app is where you get what the spec assumes you already have: an account, a balance and an API key. Keys are created in the app, shown once and revocable at any time. The [API keys](https://similariq.ai/features/api-keys) page explains how to handle them.

The app is also the quickest way to understand the data before you generate anything. Run a search, look at the results table with match score, type and confidence, and export the list as JSON. That export shows you real values for the fields the spec defines, which makes the schema much easier to read.

## Using the spec with code generators, API tools and agents

For code generation, feed the URL or a saved copy to an OpenAPI generator for your language. For exploration, import it into an API client that understands OpenAPI and add your key as the `X-API-Key` header. For validation, use it in tests to check that the requests your code builds match the described shapes.

For AI agents there are two routes. If the agent framework builds tools from OpenAPI operations, give it the spec and it can call search and balance directly over HTTP. If the agent speaks the Model Context Protocol, skip the spec and connect the hosted [MCP server](https://similariq.ai/features/mcp-server) at `https://similariq.ai/mcp`, which already exposes ten tools and supports OAuth sign-in. The guide on [API versus MCP server](https://similariq.ai/guides/api-vs-mcp-server) compares the two.

A simple way to fetch the file from a terminal is `curl -s https://similariq.ai/openapi.json -o openapi.json`. Whether the file can be fetched without a key is not stated in the published facts; if a request is refused, send your key in the header.

## What it costs

The spec is a description, not a product. There is no charge listed for it, and SimilarIQ has no separate API plan. API calls draw on the same pay-as-you-go balance as app searches and MCP tool calls, at the same price: $0.0025 per look-alike, 100 per search, $0.25 per search.

What you generate from the spec inherits the same cost rules as any other caller. A search is one credit at any `limit`. A bulk upload is one credit per domain. Reads such as history, past results and the balance check are free. A failed search returns 502 and the credit is refunded automatically.

## Pitfalls to avoid

The first pitfall is generated clients with short timeouts. Some HTTP clients default to timeouts of a few seconds. A SimilarIQ search is synchronous and takes roughly 30 to 60 seconds because it is a fresh research pass. Raise the timeout on the search operation or your generated client will give up on calls that were going to succeed.

The second is a stale copy. If you save the file and generate from the copy, your client reflects the API as it was on the day you saved it. Re-fetch the spec on a schedule or as a build step, and compare versions before you regenerate.

The third is handing an agent every operation. If the spec includes key management or bulk upload and your agent only needs to search, expose only the operations it needs. A bulk upload spends one credit per domain, and an agent should not discover that by accident. The fourth is ignoring error codes: make sure generated code distinguishes 400, 401, 402, 429 and 502.

## Pairing the spec with other features

The spec pairs with the [REST API](https://similariq.ai/features/rest-api) documentation: read the docs for intent and the spec for exact shapes. It pairs with the [errors and retries](https://similariq.ai/features/error-handling) page, since a generated client gives you status codes but not a retry policy. And it pairs with the free balance call, which is the natural first operation to wire up and test.

It also sits next to the official [SDKs and CLI](https://similariq.ai/features/sdks-and-cli). If you work in Node or Python, the SDKs are less effort than generating a client: `npm install similariq-sdk` or `pip install similariq`, with search, bulk, history, results, companies, saved companies, share and balance methods already written. Use the spec for other languages and for tooling.

## When the OpenAPI spec is not the right tool

Do not start with the spec if a simpler path exists. A one-off list is quicker in the web app. A shell script is quicker with the CLI. A Node or Python service is quicker with an SDK. A chat assistant is better connected through the MCP server than taught raw HTTP.

The spec also does not document judgement. It can tell you that `matchScore` is a number from 0 to 100. It cannot tell you what threshold suits your use case, how to read the four relationship types or when to trust a low-confidence result. Those are covered on the feature pages for each field.

Finally, a spec describes an interface, not a service level. It says nothing about rate limits beyond what the API returns, and SimilarIQ describes its limiter only as a standard per-key and per-IP limiter that smooths bursts. For dedicated throughput, email info@similariq.ai.

## Frequently asked questions

### Where is the SimilarIQ OpenAPI spec?

It is published at `https://similariq.ai/openapi.json`. Point any tool that accepts an OpenAPI URL at that address, or save a copy for tools that want a file.

### What can I do with the OpenAPI spec?

Generate a typed client in a language with no official SDK, import the API into an API explorer, validate requests in tests, or give an agent framework a definition it can turn into callable tools.

### Does SimilarIQ have official SDKs, or do I need to generate one?

There are official SDKs for Node (`similariq-sdk`) and Python (`similariq`), plus a CLI. Generating a client from the spec is mainly useful for other languages.

### Should an AI agent use the OpenAPI spec or the MCP server?

If the agent supports the Model Context Protocol, the hosted MCP server is less work: ten ready-made tools and OAuth sign-in. Use the spec when your framework builds tools from OpenAPI operations or when you want plain HTTP.

### Is the OpenAPI spec free?

No charge is listed for it, and there is no separate API plan. You pay only for searches made through the API, at $0.25 each, from the same balance the web app uses.

### Which OpenAPI version does the spec use?

That is not stated in SimilarIQ's published documentation outside the file. Open `openapi.json` and read the version field at the top before choosing a generator.
