Configuration
Configure the SALZ API for your environment -- base URL, authentication, request format, timeouts, and optional parameters.
This page covers everything you need to configure when integrating the SALZ API into your application.
Base URL
All API requests go to:
https://add-salz.io/api/v1
The current stable version is v1. Always include the version prefix in your requests.
Authentication
Every request must include your API key in the Authorization header using the Bearer scheme:
Authorization: Bearer YOUR_API_KEY
See the Authentication section for details on creating and managing API keys.
Request Format
SALZ accepts JSON request bodies. Always set the Content-Type header:
Content-Type: application/json
A minimal request body requires only the text field:
{
"text": "The text you want to optimize."
}
Response Format
Successful responses return JSON with a 200 status code:
{
"optimized": "The optimized version of your text.",
"success": true
}
Error responses include a message describing the issue:
{
"error": "Text is required",
"success": false
}
Timeout Settings
The SALZ API processes most requests within 2-5 seconds. For longer texts, processing may take up to 15 seconds. We recommend setting your HTTP client timeout to at least 30 seconds:
# curl with 30-second timeout
curl --max-time 30 -X POST https://add-salz.io/api/v1/optimize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Your text here"}'
// JavaScript fetch with AbortController timeout
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 30000);
const response = await fetch('https://add-salz.io/api/v1/optimize', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ text: 'Your text here' }),
signal: controller.signal,
});
clearTimeout(timeout);
Text Length Limits
The text field accepts up to 10,000 characters per request. If you need to process longer content, split it into smaller chunks and send multiple requests. Splitting at paragraph boundaries generally produces the best results.
Next Steps
- API Reference Overview -- Full endpoint and schema documentation
- Optimization Parameters -- Customize how SALZ optimizes your text