API Reference
Complete reference for the img2voice API • Base URL: https://api.img2voice.com • Version: v1
Overview
The img2voice API converts images to speech. Submit an image (public URL, multipart upload, or base64), the API uses vision to describe it, then generates speech in 60+ languages. The response includes the AI description and a signed audio URL (valid for 24 hours). No SDKs required — plain HTTPS JSON or multipart.
Authenticate with the IMG2VOICE-API-KEY header. Create a key in your dashboard. Requests may take up to 120 seconds (vision + TTS).
Authentication
All API requests must include your API key in the IMG2VOICE-API-KEY header. Production keys are prefixed with sk_live_.
IMG2VOICE-API-KEY: sk_live_your_api_key_hereConvert image
https://api.img2voice.com/v1Submit one image and optional voice/language settings. Provide exactly one image source: multipart field image, image_url, or image_base64. Max upload size: 10 MB. Supported MIME types: JPEG, PNG, WebP, BMP, TIFF.
Costs 1 image credit per successful request. WAV output requires a paid plan (not free).
Parameters
JSON body fields (also accepted as multipart form fields when uploading a file):
| Parameter | Type | Required | Description |
|---|---|---|---|
| image_url | string | Yes* | Public HTTP/HTTPS URL of the image. Private/loopback addresses are rejected. *One of image_url, image_base64, or multipart field image is required. |
| image_base64 | string | Yes* | Raw base64 image data (no data-URI prefix). Formats: JPEG, PNG, WebP, BMP, TIFF. |
| image_mime_type | string | No | MIME type when using image_base64. One of image/jpeg, image/png, image/webp, image/bmp, image/tiff. Default: image/jpeg. |
| image | file | Yes* | Multipart form field name for file upload. Max 10 MB. |
| voice_id | string | No | Voice: eve, ara, rex, sal, or leo. Default: eve. |
| language | string | No | BCP-47 code (e.g. "en", "es", "ja") or "auto". Default: auto. |
| detail | string | No | "brief", "standard", or "detailed". Default: standard. |
| output_format | string | No | "mp3" or "wav". Default: mp3. WAV requires a paid plan. |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique request ID (prefix img_). |
| status | string | "completed" on success. |
| description | string | AI-generated description (translated when language is set). |
| audio_url | string | Signed URL to the audio file, valid for 24 hours. |
| duration_seconds | number | Estimated audio length in seconds. |
| image_credits_used | integer | Credits consumed (always 1 for this endpoint). |
| image_credits_remaining | integer | Credits left after this request. |
| voice_id | string | Voice used. |
| created_at | string | ISO 8601 timestamp. |
| source_language | string | Present only when translation occurred. |
| translated | boolean | true when the description was translated. |
Code examples
Ready-to-copy examples for each image input method. Each block has a copy button.
URL input
curl -X POST https://api.img2voice.com/v1 \
-H "IMG2VOICE-API-KEY: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/photo.png",
"voice_id": "eve",
"language": "en",
"detail": "standard",
"output_format": "mp3"
}'Multipart file upload
curl -X POST https://api.img2voice.com/v1 \
-H "IMG2VOICE-API-KEY: sk_live_your_api_key_here" \
-F "image=@./photo.png" \
-F "voice_id=eve" \
-F "language=en" \
-F "detail=standard" \
-F "output_format=mp3"Base64 JSON
curl -X POST https://api.img2voice.com/v1 \
-H "IMG2VOICE-API-KEY: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"image_base64": "'"$(base64 < photo.png | tr -d '\n')"'",
"image_mime_type": "image/jpeg",
"voice_id": "eve",
"language": "auto",
"output_format": "mp3"
}'Batch
https://api.img2voice.com/v1/batchProcess multiple images in one request. Requires a paid plan (plan_required otherwise). Max batch size is 20 items. Each item must include a public image_url (URL input only — no multipart/base64 in batch). Credits are reserved upfront; failed items are refunded.
| Field | Type | Description |
|---|---|---|
| requests | array | Non-empty array of items. Each item supports image_url (required), voice_id, language, output_format, detail. |
| results | array | Per-item result. Completed items match the single-convert response (without credit fields). Failed items include status "failed" and an error object. |
| total | integer | Number of items in the batch. |
curl -X POST https://api.img2voice.com/v1/batch \
-H "IMG2VOICE-API-KEY: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"requests": [
{"image_url": "https://example.com/a.png", "voice_id": "eve"},
{"image_url": "https://example.com/b.png", "voice_id": "ara", "language": "es"}
]
}'Account
https://api.img2voice.com/v1/accountReturns the authenticated key's plan, credit balance, rate limit (rpm), and batch size.
{
"email": "you@example.com",
"plan": "paid",
"key": "sk_live_…",
"image_balance": 180,
"images_used": 20,
"rpm": 200,
"batch_size": 20
}curl https://api.img2voice.com/v1/account \
-H "IMG2VOICE-API-KEY: sk_live_your_api_key_here"Rate limits
Limits are per API key. When exceeded, the API returns HTTP 429 with a Retry-After header and retry_after in the JSON body (seconds).
| Plan | Req / min | Concurrent | Batch size |
|---|---|---|---|
| Demo | 5 | 1 | 0 (not available) |
| Free | 10 | 1 | 0 (not available) |
| Starter | 200 | 10 | 0 (not available) |
| Paid | 200 | 10 | 20 |
Signup grants 25 free image credits. The anonymous homepage demo allows 3 images per IP per day.
Error codes
Errors return JSON with an error object containing code and message. Rate-limit errors also include retry_after.
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded (200 req/min on paid plan). Retry after 18s.",
"retry_after": 18
}
}| Code | HTTP | Description |
|---|---|---|
| invalid_api_key | 401 | API key missing, invalid, or revoked. |
| invalid_request | 400 | Missing image, bad URL/base64, unsupported MIME type, invalid output_format/detail, upload error, or batch validation failure. |
| invalid_voice | 400 | voice_id not one of: eve, ara, rex, sal, leo. |
| invalid_language | 400 | language is not a supported BCP-47 code or "auto". |
| text_too_long | 400 | Generated text exceeds TTS limits. |
| rate_limit_exceeded | 429 | Requests-per-minute exceeded. Use Retry-After / retry_after. |
| demo_limit_reached | 429 | Anonymous demo daily limit (3 images/IP) reached. |
| quota_exceeded | 402 | No image credits remaining (or not enough for a batch). |
| plan_required | 403 | Feature needs a paid plan (batch, WAV output, CSV export). |
| not_found | 404 | Unknown route. |
| server_error | 500 | Vision, TTS, storage, or unexpected failure. Retry; contact support if it persists. |
Questions? support@img2voice.com