/ AI Agent API
Docs/AI Agent API

AI Agent API

REST API for AI agents. Save tokens by calling tools instead of generating code.

Authentication

# Pass API key in header:
curl -H "x-api-key: tpx_your_key_here" https://toolpix.dev/api/v1/tokens

# Or as query parameter:
curl "https://toolpix.dev/api/v1/tokens?key=tpx_your_key_here"

# Get your key at: https://toolpix.dev/console/api-keys

Endpoints

POST/api/v1/tokens

Count tokens for any text across models

Request:
{ "text": "Hello world", "models": ["gpt-4o", "claude"] }
Response:
{ "gpt4o": { "tokens": 2, "cost": "$0.000005" }, "claude": { "tokens": 2, "cost": "$0.000006" } }
POST/api/v1/compress-prompt🔑 API Key required

Compress prompts to save tokens

Request:
{ "prompt": "Please kindly provide a detailed explanation of..." }
Response:
{ "optimized": "Explain...", "saved": "45%", "originalTokens": 120, "optimizedTokens": 66 }
POST/api/v1/regex🔑 API Key required

Generate regex from description

Request:
{ "description": "match email addresses" }
Response:
{ "regex": "/[\\w.-]+@[\\w.-]+\\.\\w+/g", "explanation": "..." }
POST/api/v1/detect-ai🔑 API Key required

Detect if text is AI-generated

Request:
{ "text": "The unprecedented paradigm shift..." }
Response:
{ "score": 82, "verdict": "Likely AI", "confidence": "high" }
POST/api/v1/tone🔑 API Key required

Change text tone

Request:
{ "text": "Hey dude, check this out", "tone": "formal" }
Response:
{ "result": "I would like to draw your attention to the following..." }
POST/api/v1/template

Fill prompt template with variables

Request:
{ "template": "blog-post", "variables": { "topic": "AI Safety" } }
Response:
{ "prompt": "Write a blog post about AI Safety..." }
GET/api/v1/tools

List available API tools

Response:
{ "tools": [{ "slug": "regex", "description": "...", "method": "POST" }, ...] }

Rate Limits

PlanAI calls/dayRequests/dayPrice
Free5Free
Basic1050$4.99/mo
Pro50200$9.99/mo
Unlimited5009,999$29.99/mo

View full pricing →