Authentication
Copy your API key from My Dashboard and send it with each request. Header authentication keeps credentials out of URLs and server logs.
X-TinySharp-Key: tsh_live_your_key
Authorization: Bearer tsh_live_your_key
Token status
Use the token endpoint to check the active plan and remaining optimization credits for the API key.
GET /wp-json/sio/v1/tokens
X-TinySharp-Key: tsh_live_your_key
Optimize an image
Send an image file with quality and output format options. The API returns optimized image data, metadata and remaining token information.
POST /wp-json/sio/v1/optimize
Content-Type: multipart/form-data
image=@photo.jpg
quality=82
output_format=webp
Common responses
401 means the API key is missing or invalid. 402 means there are not enough tokens. 415 means the file type is not supported. 429 may be used for rate limits.