Calling Tools
How to call tools with the TypeScript SDK or REST — JSON, multipart, and response formats.
All tool endpoints require X-Api-Key (or pass apiKey to the SDK). Base URL: https://api.toolyour.com.
Prefer typed calls? See TypeScript SDK and the full SDK Tool Map (REST path ↔ SDK method for every tool).
TypeScript SDK patterns
import { ToolYour } from "@toolyour/sdk";
const ty = ToolYour({ apiKey: process.env.TOOLYOUR_API_KEY! });
// JSON POST (text utilities, calculators, many security POST tools)
await ty.text.textCaseConverter({ text: "hello", case: "uppercase" });
// GET with url query (most SEO + security URL tools)
await ty.seo.pageSpeedAnalyzer({ url: "https://example.com" });
// Multipart file upload (documents, convertors)
await ty.documents.docxToPdf({ file: fileBlob });
// Generic by operationId (from OpenAPI)
await ty.invoke("gst_calculator", { amount: 100, rate: 18, mode: "exclusive" });JSON body tools (REST)
Text utilities and many SEO tools accept JSON:
curl -X POST "https://api.toolyour.com/api/v1/text-utilities/text-case-converter" \
-H "Content-Type: application/json" \
-H "X-Api-Key: $API_KEY" \
-d '{"text":"hello world","case":"uppercase"}'File upload tools
Convertors and document APIs use multipart/form-data:
curl -X POST "https://api.toolyour.com/api/v1/documents/pdf-to-docx" \
-H "X-Api-Key: $API_KEY" \
-F "[email protected]"Document and media conversion routes follow the same pattern — upload the source file in the file field unless the API reference specifies a different field name (e.g. image for image convertors).
File conversion responses (default)
Most convertor, document, office, web, eBook, and archive endpoints return JSON with a presigned download URL — not raw file bytes:
{
"status": true,
"code": 200,
"message": "Conversion successful",
"result": {
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"downloadUrl": "https://…",
"expiresAt": "2026-06-20T20:00:00.000Z",
"fileName": "report.pdf",
"mimeType": "application/pdf",
"sizeBytes": 102400
}
}downloadUrl— presigned GET link (valid 1 hour)- Download the file with a second HTTP GET (no API key on that GET)
- Files are removed from storage within 24 hours at latest
Legacy binary delivery
During the deprecation window, add ?delivery=binary to receive the file bytes directly in the conversion response (includes Deprecation and Sunset headers). Prefer the default JSON + downloadUrl flow for new integrations.
Exceptions (not temp-file URLs)
| Route | Response |
|---|---|
convertors/to-base64 | Plain text base64 |
convertors/image-metadata | JSON metadata |
convertors/csv-2-json | JSON in body |
| Text / SEO / calculator tools | JSON result objects |
OpenAPI playground (Send button)
Each endpoint page in the OpenAPI sidebar includes a Send control. Set your X-Api-Key in the playground auth panel, choose server https://api.toolyour.com, then send.
Requests are proxied through /developers/api/proxy on the docs site to avoid browser CORS errors. Use the playground on www.toolyour.com/developers/docs.
Rate limits
Plans may include per-minute rate limits. Monthly quota is enforced per account (shared across all your API keys). See Usage & Plans.
Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | Tool blocked for your key/plan |
410 | ?delivery=binary no longer supported |
429 | Quota or rate limit exceeded |
503 | Service temporarily unavailable |
See Errors for troubleshooting.
MCP (AI agents)
Agents call API-backed tools via MCP at https://api.toolyour.com/mcp with your API key. MCP tool names align with SDK method names (e.g. metaTagsAnalyzer). Generate config with @toolyour/sdk/mcp — see MCP quickstart and TypeScript SDK.