# Overview

> What the ImgSearch API and MCP server do, the three ways in, and the order every agent follows.

## What the API is

ImgSearch is a library of photos, SVG illustrations and packs, brand logos, sound effects, 3D models and videos, with an AI Generator for what the library lacks. The API lets your code and your agents use both:

- **Search** every source at once, with scores that mean roughly the same across sources, and with what generating instead would cost.
- **Download** what fits, under the same fair use as the website. Files you already downloaded are free to fetch again.
- **Generate** with the AI Generator when nothing fits: images, videos, voiceovers, memes, music, 3D models and SVGs, at the website’s prices, in US dollars.

It also lists your own generations, your AI balance and its history, and sends events to your webhooks.


## Three ways in

- **The REST API** with an API key: for your scripts, servers and agents. Start with the [quickstart](https://imgsearch.com/developers/quickstart.md).
- **The MCP server** at `https://imgsearch.com/mcp`: for AI tools such as Claude Code, Codex and Cursor. The person signs in once and the tool gets its own token. See [MCP](https://imgsearch.com/developers/mcp.md).
- **`llms.txt`** at `https://imgsearch.com/llms.txt`: a short Markdown file that tells an agent what ImgSearch is, how to call it and the order to follow. Point your agent at it, or paste the [AGENTS snippet](https://imgsearch.com/developers/agents.md#the-agents-snippet) into your project.

## The order

Every guide and every agent text uses the same four steps:

1. Search first. For any need for an image, illustration, icon, video, sound, music, voice or 3D model, search once per distinct need, in the user’s own generations and the ImgSearch library. Searching is free.
2. Inspect. Read each result’s description, size and license, and its band where one is given: strong usually fits when the description shows what was asked for; possible needs a closer look. Prefer results the user made or already owns, which cost nothing. If a search says it is incomplete, search again before deciding.
3. Reuse if one fits. Download only the items you chose.
4. Generate only if nothing fits, and only where generating is offered. Check the estimate first and stay within the most the user allowed; ask the user before going higher. If a request is refused for its content, tell the user; do not rephrase or retry it.

The [search first](https://imgsearch.com/developers/search-first.md) guide explains each step.

## Basics

- Base URL `https://imgsearch.com/api/v2`, version `2.0.0`. Every answer carries `ImgSearch-Api-Version`.
- Send `Authorization: Bearer <key>` on every call but the public ones (the index, status, models, licenses and the OpenAPI document).
- JSON in and out, except uploads (multipart), files, redirects and the YAML spec. Every answer carries an `X-Request-Id` header; send your own (letters, digits, `.`, `_`, `:`, `-`, up to 128 characters) to trace a call.
- Every error has one envelope with a `code`: see [errors](https://imgsearch.com/developers/errors.md).
- Lists page with `next_cursor`, at most 100 items a page.
- The [OpenAPI document](https://imgsearch.com/developers/reference.md) is at `https://imgsearch.com/api/v2/openapi.yaml` and `https://imgsearch.com/api/v2/openapi.json`.
- Changes within v2 only add. The [changelog](https://imgsearch.com/developers/changelog.md) lists them.


## Where to go next

- [Quickstart](https://imgsearch.com/developers/quickstart.md): a key, a search, a download and, if you need one, a generation.
- [Authentication and spending](https://imgsearch.com/developers/authentication.md): keys, scopes and letting a key spend AI balance.
- [Generation](https://imgsearch.com/developers/generation.md) and [models](https://imgsearch.com/developers/models.md): kinds, options, prices and waiting for results.
- [Errors](https://imgsearch.com/developers/errors.md) and [limits](https://imgsearch.com/developers/limits.md): what each code means and how many calls you can make.
- [API reference](https://imgsearch.com/developers/reference.md): every operation, with examples in curl, Python and JavaScript.
