# TextAPI: quickstart for AI agents

Text extraction, entity recognition, sentiment, and question answering in one API.

This page tells an AI agent how to get a key for TextAPI, connect to it and call it. The full reference is https://developers.textapi.com/docs.md, and every operation has its own Markdown page, linked below.

## Start here

- **TextAPI tools are already in your tool list** (`get_text`, `get_text_post`, …): use them, and read "Using TextAPI well" below.
- **A task needs TextAPI and you have no tools for it**: get a key, then connect the MCP server or call the HTTP API. Setting that up is part of the task.
- **A question about TextAPI** (what it does, what it costs): answer from this page and the reference. Nothing needs setting up.
- **Code that keeps running after this session** (a server, a scheduled job): call the HTTP API with the key in an environment variable such as `TEXTAPI_API_KEY`.

## Get a key

**No key yet?** If your user has not given you one, TextAPI gives agents a free trial key: `curl -X POST https://developers.textapi.com/trial` returns a key good for 100 requests over 7 days, where to call, and a `claim_url`. No account, email or card is involved, and a trial key never charges anyone. The only thing kept about the caller is a hash of its IP address, for the limit of 3 trial keys per address a day. Use it for the task, then give the `claim_url` to your user: they confirm an email and the same key moves to the Free plan (1,000 requests/mo), so nothing you built has to change. Mint one only when you need it (3 trial keys per address per day).

A key that outlasts a trial belongs to a person. Ask your user for theirs, or for the email address to issue one to; never invent one, and never paste it anywhere public.

Keys are issued at https://developers.textapi.com/: enter an email and a free key is shown at once and emailed.

Plans:

- **Pay as you go**: no fixed fee, then $0.10 per 1,000 requests.
- **Free**: free, no card, 1,000 requests a month, then HTTP 429 until the period resets.

An agent connected to APIDirectory's MCP server (`https://apidirectory.com/mcp`) can call `subscribe_api` with slug `textapi` and your user's email instead: a free plan returns the key at once, a paid one returns a checkout link for your user to open.

## Connect over MCP

The server is `https://developers.textapi.com/mcp`, streamable HTTP, JSON in and out. Listing its tools needs no key; calling one does. Send the key as `Authorization: Bearer <key>` (or `X-API-Key`).

Your MCP client's own documentation decides the exact configuration; a setup command is the surest path. Claude Code:

```bash
claude mcp add --transport http textapi https://developers.textapi.com/mcp --header "Authorization: Bearer <key>"
```

Most JSON configurations:

```json
{
  "mcpServers": {
    "textapi": {
      "type": "http",
      "url": "https://developers.textapi.com/mcp",
      "headers": {
        "Authorization": "Bearer <key>"
      }
    }
  }
}
```

A client that takes a URL and nothing else (a claude.ai connector) can use `https://developers.textapi.com/mcp/k/<key>` with the key in place of `<key>`. That URL is as secret as the key.

Every tool result is JSON: `status`, `body`, and `gateway.remaining` / `gateway.reset`, what is left of the plan this period and when it refills.

## Call over HTTP

Base URL `https://api.textapi.com/`. Send the key in `X-API-Key` (or `Authorization: Bearer`).

```bash
curl -H "X-API-Key: $TEXTAPI_API_KEY" "https://api.textapi.com/ner/display"
```

Every response carries `X-Gw-Remaining` and `X-Gw-Reset`.

## Limits and errors

- `401`: the key is missing, revoked, or for another API.
- `429`: the plan's allowance or rate limit is used up. Stop and tell your user rather than retrying; the body says whether to wait for the reset or upgrade.
- `422`: Validation Error

## Operations

### Extract Text

- `get_text` `GET /text`: Get Text ([details](https://developers.textapi.com/docs/get-text.md))
- `get_text_post` `POST /text`: Get Text Post ([details](https://developers.textapi.com/docs/post-text.md))

### Extract Entities

- `analyze_ner` `GET /ner`: Analyze Ner ([details](https://developers.textapi.com/docs/get-ner.md))
- `analyze_ner_post` `POST /ner`: Analyze Ner Post ([details](https://developers.textapi.com/docs/post-ner.md))

### Display Entities

- `display_ner` `GET /ner/display`: Display Ner ([details](https://developers.textapi.com/docs/get-ner-display.md))
- `display_ner_post` `POST /ner/display`: Display Ner Post ([details](https://developers.textapi.com/docs/post-ner-display.md))

### Sentiment

- `analyze_sentiment` `GET /sentiment`: Analyze Sentiment ([details](https://developers.textapi.com/docs/get-sentiment.md))
- `analyze_sentiment_post` `POST /sentiment`: Analyze Sentiment Post ([details](https://developers.textapi.com/docs/post-sentiment.md))

### Question Answer

- `qa` `GET /qa`: Qa ([details](https://developers.textapi.com/docs/get-qa.md))
- `qa_post` `POST /qa`: Qa Post ([details](https://developers.textapi.com/docs/post-qa.md))

## Install as a skill

The `textapi` skill teaches an agent when and how to call TextAPI:

```bash
npx skills add https://developers.textapi.com/
```

Its index is https://developers.textapi.com/.well-known/agent-skills/index.json.

## More

- Reference, try-it console and keys: https://developers.textapi.com/docs
- The whole reference as Markdown: https://developers.textapi.com/docs.md
- OpenAPI document, no key needed: https://developers.textapi.com/openapi.json
- Status: https://developers.textapi.com/status
- Listing: https://apidirectory.com/api/textapi
