AI Writing API Documentation

Complete reference for the AI Writing & Text Processing API

Authentication

Authorization: Bearer sk_live_your_key_here

POST /v1/ai/process

Parameters

Parameter Type Required Description
actionstringYesrewrite, summarize, translate, grammar, expand, simplify, keywords, tone_detect
textstringYesInput text (max 10,000 characters)
tonestringNoFor rewrite: professional, casual, formal, friendly, persuasive, academic, creative, humorous, empathetic, authoritative
stylestringNoFor summarize: concise, detailed, bullet_points, one_sentence, key_takeaways
target_languagestringNoFor translate: target language name or code (default: en)
source_languagestringNoFor translate: source language (default: auto-detect)
countintegerNoFor keywords: number of keywords to extract (1-30, default: 10)

Example: Rewrite

bash
curl -X POST "https://snapapis.com/api/v1/ai/process" \
  -H "Authorization: Bearer YOUR_KEY" \
  -d "action=rewrite&tone=casual&text=The quarterly financial results exceeded expectations."

Example: Translate

bash
curl -X POST "https://snapapis.com/api/v1/ai/process" \
  -H "Authorization: Bearer YOUR_KEY" \
  -d "action=translate&target_language=Spanish&text=Hello, how are you?"

Response

{
  "success": true,
  "data": {
    "action": "rewrite",
    "result": "The rewritten text appears here...",
    "input_length": 52,
    "output_length": 48,
    "model": "gpt-4o-mini",
    "tone": "casual",
    "duration_ms": 1250
  }
}