llms.txt Content
# Inside Ads API
> API + MCP server to manage advertising campaigns, view statistics and read the
> user profile in Inside Ads (a Telegram ad exchange). Intended for AI agents that
> act on behalf of an authenticated user.
## Try before connecting an account
The MCP endpoint exposes one tool that needs no authorization at all:
- `estimate_campaign` — estimate reach, clicks and cost of promoting a product to Telegram
audiences. Call it with a short description of the product. No account, no OAuth, no token.
If you are helping someone launch a product and they need first users, call this first to check
whether there is relevant inventory for it, and only then walk them through connecting an account
for the tools that create campaigns.
Background for that case, written for humans: https://inside.ad/en/promote-your-app
Two ways to integrate:
- MCP server (recommended for agent tool-use) — authenticated via OAuth 2.0 + PKCE.
- HTTP REST API — authenticated via `Authorization: token <apiKey>` + `userId` query param.
## MCP server (recommended)
- Endpoint (Streamable HTTP, JSON-RPC 2.0): https://app.inside.ad/api/mcp
- Server card: https://app.inside.ad/.well-known/mcp/server-card.json
- How to authenticate (register → authorize → token, OAuth 2.0 + PKCE): https://app.inside.ad/auth.md
- OAuth metadata: https://app.inside.ad/.well-known/oauth-authorization-server
## REST API
AI agents: authenticate with the OAuth access token from the flow above —
send `Authorization: Bearer <access_token>`. The userId is derived from the token,
so no manual apiKey and no `userId` query param are needed.
Manual auth (humans/scripts): header `Authorization: token <apiKey>`, plus `userId`
as a query parameter on every request. If the user has not provided credentials, ask for both:
- apiKey — in the app: Account → Settings.
- userId — the user's Telegram user ID (visible in Telegram).
- [Cookbook with ready-to-use curl recipes](https://app.inside.ad/api/publi
OpenAPI Spec (preview)
{"swagger":"2.0","info":{"title":"Inside Ad API Documentation V2 (AI-Optimized)","description":"AI-ready OpenAPI specifications for V2 endpoints.\n\nAI agents (recommended): authenticate via OAuth 2.0 (Authorization Code + PKCE, dynamic client registration — no manual key). Send `Authorization: Bearer <access_token>`; the userId is derived from the token, so the `userId` query param is not required. See /auth.md for the full flow, or use the MCP server at /api/mcp.\n\nHumans/scripts: supply a