API Documentation
Everything you need to integrate InstantAPI into your application. A single endpoint powers six AI capabilities at $0.50 per call.
https://instantapis.net/api/openapi directly into Postman to generate a complete collection1Authentication
All API requests require authentication via the Authorization header. Include your API key as a Bearer token with every request.
Authorization: Bearer your_api_key_hereYou can get your API key from the dashboard. Keep your API key secret -- do not expose it in client-side code or public repositories.
2Base URL
All API requests should be made to the following base URL:
3Endpoint
This is the single, unified endpoint for all AI tasks. Specify the task you want to perform in the request body. Every call costs $0.50 regardless of the task.
4Request Format
Send a JSON body with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
task | string | Required | One of: summarize, extract, analyze, translate, sentiment, code |
input | string | Required | The text or data to process |
options | object | Optional | Task-specific options (see each task below) |
{
"task": "summarize",
"input": "Your text content here...",
"options": {
"length": "short"
}
}5Tasks
InstantAPI supports six AI-powered tasks. Each task is accessed through the same /generate endpoint.
Summarize
Condense long text into clear, concise summaries.
Options
length(string)-- "short" | "medium" | "long" - Controls summary length. Defaults to "medium".Request
{
"task": "summarize",
"input": "Artificial intelligence has transformed the way businesses operate. From automating routine tasks to providing deep insights from complex data sets, AI technologies are being adopted across every industry. Machine learning algorithms can now process vast amounts of information in seconds, enabling real-time decision making that was previously impossible...",
"options": {
"length": "short"
}
}Response
{
"success": true,
"data": {
"summary": "AI is revolutionizing business operations through task automation and data-driven insights, with machine learning enabling real-time decision making across industries."
},
"task": "summarize",
"timestamp": "2026-03-25T12:00:00.000Z"
}Extract
Extract structured data from unstructured text.
Options
fields(string[])-- Array of field names to extract. e.g. ["name", "email", "phone"]Request
{
"task": "extract",
"input": "Contact John Smith at john@example.com or call him at (555) 123-4567. He works as a Senior Engineer at Acme Corp since 2019.",
"options": {
"fields": ["name", "email", "phone", "title", "company"]
}
}Response
{
"success": true,
"data": {
"name": "John Smith",
"email": "john@example.com",
"phone": "(555) 123-4567",
"title": "Senior Engineer",
"company": "Acme Corp"
},
"task": "extract",
"timestamp": "2026-03-25T12:00:00.000Z"
}Analyze
Analyze data or text for patterns, trends, and insights.
Request
{
"task": "analyze",
"input": "Q1 Revenue: $2.1M (up 15%), Q2 Revenue: $2.4M (up 14%), Q3 Revenue: $2.9M (up 21%), Q4 Revenue: $3.1M (up 7%). Customer churn decreased from 5.2% to 3.8%. New customer acquisition cost dropped by 12%."
}Response
{
"success": true,
"data": {
"insights": [
"Annual revenue of $10.5M with consistent quarter-over-quarter growth",
"Q3 showed strongest growth at 21%, while Q4 growth slowed to 7%",
"Customer retention improved significantly with churn dropping 1.4 percentage points",
"Lower acquisition costs combined with reduced churn suggest improving unit economics"
],
"trends": ["accelerating_revenue", "improving_retention", "decreasing_cac"],
"sentiment": "positive"
},
"task": "analyze",
"timestamp": "2026-03-25T12:00:00.000Z"
}Translate
Translate text between 100+ languages with context-aware accuracy.
Options
targetLanguage(string)-- Target language for translation. e.g. "spanish", "french", "japanese"Request
{
"task": "translate",
"input": "The quick brown fox jumps over the lazy dog. This is a common pangram used in typography.",
"options": {
"targetLanguage": "spanish"
}
}Response
{
"success": true,
"data": {
"translation": "El rápido zorro marrón salta sobre el perro perezoso. Este es un pangrama común utilizado en tipografía.",
"sourceLanguage": "english",
"targetLanguage": "spanish"
},
"task": "translate",
"timestamp": "2026-03-25T12:00:00.000Z"
}Sentiment
Analyze the tone, emotion, and intent behind any text.
Request
{
"task": "sentiment",
"input": "I absolutely love this product! The customer service team was incredibly helpful and resolved my issue within minutes. Will definitely recommend to friends."
}Response
{
"success": true,
"data": {
"sentiment": "positive",
"confidence": 0.96,
"emotions": {
"joy": 0.85,
"trust": 0.78,
"surprise": 0.12,
"anger": 0.01
},
"aspects": [
{ "topic": "product", "sentiment": "positive" },
{ "topic": "customer service", "sentiment": "positive" },
{ "topic": "responsiveness", "sentiment": "positive" }
]
},
"task": "sentiment",
"timestamp": "2026-03-25T12:00:00.000Z"
}Code
Generate, explain, or refactor code in 50+ programming languages.
Options
language(string)-- Programming language. e.g. "python", "javascript", "rust", "go"Request
{
"task": "code",
"input": "Write a function that checks if a string is a valid palindrome, ignoring spaces and punctuation",
"options": {
"language": "python"
}
}Response
{
"success": true,
"data": {
"code": "import re\n\ndef is_palindrome(s: str) -> bool:\n cleaned = re.sub(r'[^a-zA-Z0-9]', '', s).lower()\n return cleaned == cleaned[::-1]",
"language": "python",
"explanation": "This function strips all non-alphanumeric characters using regex, converts to lowercase, then checks if the string reads the same forwards and backwards."
},
"task": "code",
"timestamp": "2026-03-25T12:00:00.000Z"
}6Response Format
All successful responses follow the same JSON structure:
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request was successful |
data | object | The result data, varies by task |
task | string | The task that was executed |
timestamp | string | ISO 8601 timestamp of the response |
{
"success": true,
"data": {
// Task-specific result data
},
"task": "summarize",
"timestamp": "2026-03-25T12:00:00.000Z"
}Error responses include an error field instead of data:
{
"success": false,
"error": {
"code": 401,
"message": "Invalid API key"
},
"timestamp": "2026-03-25T12:00:00.000Z"
}7Error Codes
Unauthorized
Invalid or missing API key. Check your Authorization header.
Payment Required
No credits remaining. Add credits in your dashboard.
Too Many Requests
Rate limit exceeded. Wait and retry with exponential backoff.
Internal Server Error
Something went wrong on our end. You are not charged for 5xx errors.
8Code Examples
curl -X POST https://instantapis.net/api/v1/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"task": "summarize",
"input": "Your long text goes here...",
"options": {
"length": "short"
}
}'9Rate Limits
To ensure fair usage and platform stability, API calls are rate-limited per API key.
60
Requests / minute
1,000
Requests / hour
10,000
Requests / day
When rate limited, you will receive a 429 status code. Implement exponential backoff in your retry logic. Rate limit headers (X-RateLimit-Remaining, X-RateLimit-Reset) are included in every response.
Need higher limits? Contact our sales team for enterprise rate limits.
10Batch API
Process multiple tasks in a single request using the batch endpoint. Up to 20 tasks per batch, processed concurrently.
Endpoint
https://instantapis.net/api/v1/batchRequest
{
"tasks": [
{ "id": "req_1", "task": "summarize", "input": "Long text...", "options": {} },
{ "id": "req_2", "task": "sentiment", "input": "Review text..." },
{ "id": "req_3", "task": "extract", "input": "Contact info..." }
]
}Response
{
"success": true,
"data": {
"results": [
{ "id": "req_1", "success": true, "data": { "summary": "..." } },
{ "id": "req_2", "success": true, "data": { "sentiment": "positive" } },
{ "id": "req_3", "success": false, "data": null, "error": "AI processing failed." }
],
"summary": { "total": 3, "succeeded": 2, "failed": 1 }
},
"meta": { "requestId": "batch_...", "credits_remaining": 47 }
}Key Details
- •Max batch size: 20 tasks per request
- •Cost: $0.50 per task (same as single calls)
- •Credits: Deducted upfront, refunded for failed tasks
- •Concurrency: Up to 5 tasks processed in parallel
- •Partial results: Some tasks can succeed while others fail
- •Task ID: Optional — auto-generated as
task_0,task_1, etc. if not provided
11SDKs
Official SDKs for JavaScript/TypeScript and Python. Install via npm or pip, or copy the source directly.
JavaScript / TypeScript
npm install instantapiimport InstantAPI from 'instantapi';
const api = new InstantAPI('ia_live_your_key');
// Single task
const summary = await api.summarize('Long article text here...');
console.log(summary.data);
// Batch processing
const batch = await api.batch([
{ task: 'summarize', input: 'Article text...' },
{ task: 'sentiment', input: 'I love this product!' },
{ task: 'extract', input: 'John at john@example.com', options: { fields: ['name', 'email'] } },
]);
console.log(batch.data.summary); // { total: 3, succeeded: 3, failed: 0 }Python
pip install instantapifrom instantapi import InstantAPI
api = InstantAPI("ia_live_your_key")
# Single task
result = api.summarize("Long article text here...")
print(result["data"])
# Batch processing
result = api.batch([
{"task": "summarize", "input": "Article text..."},
{"task": "sentiment", "input": "I love this product!"},
{"task": "extract", "input": "John at john@example.com",
"options": {"fields": ["name", "email"]}},
])
for r in result["data"]["results"]:
print(r["id"], r["success"])Both SDKs support all 6 tasks (summarize, extract, analyze, translate, sentiment, code) plus the batch API. Source code available on GitHub.
12Webhooks
Receive real-time notifications when events happen in your account. Configure webhook endpoints in your dashboard.
Event Types
| Event | Description |
|---|---|
| task.completed | Fired when a single API task succeeds |
| task.failed | Fired when a single API task fails |
| batch.completed | Fired when a batch request finishes processing |
| credits.low | Fired when credits drop to 2 or below |
| credits.depleted | Fired when credits reach 0 |
Payload Format
Every webhook delivery is a POST request with a JSON body:
{
"event": "task.completed",
"data": {
"requestId": "abc-123",
"task": "summarize",
"latencyMs": 542,
"cached": false
},
"timestamp": "2026-03-28T12:00:00.000Z",
"webhook_id": "endpoint_id"
}Verifying Signatures
Every request includes an X-InstantAPI-Signature header containing an HMAC-SHA256 hex digest of the raw body, signed with your endpoint secret.
// Node.js signature verification
const crypto = require('crypto');
function verifyWebhook(body, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// In your endpoint handler:
app.post('/webhook', (req, res) => {
const sig = req.headers['x-instantapi-signature'];
const valid = verifyWebhook(
JSON.stringify(req.body),
sig,
process.env.WEBHOOK_SECRET
);
if (!valid) return res.status(401).send('Invalid signature');
// Process the event...
res.status(200).send('OK');
});Retry Policy
Failed deliveries are retried up to 5 times with exponential backoff: 30s, 2min, 8min, 32min. After 5 failed attempts the delivery is marked as permanently failed.
Managing Endpoints
Create and manage endpoints via the Webhooks Dashboard or the REST API at /api/webhooks (GET, POST, PATCH, DELETE).
13Pricing
All six tasks, same price. No subscriptions or monthly fees. You only pay for successful API calls. Failed calls (5xx errors) are never charged.
- All 6 tasks included
- No minimum commitment
- Volume discounts available
- Credits never expire
Ready to start building?
Sign up for free, get 10 API calls on us, and start integrating in minutes.
Get Your API Key