Generate your first audio file in a few minutes. This guide uses curl — see below for Node.js and PHP-style examples.
1
Get your API key
Open Voicgen dashboard → Config → API keys and create or copy a key. It starts with vg_live_.
2
Trigger audio generation
Send a POST request with your post ID and content. The post_id is your own identifier — use your CMS article ID or any unique string. Content must be at least 50 characters.
3
Poll for completion
Poll the status endpoint every few seconds until status is "ready", or use the authenticated GET /v1/audio/{post_id}/status with your API key from server-side code.
4
Use the audio URL
The status response includes an audio_url pointing to the MP3 when status is ready. Embed it in your player or download it.
Full example — curl
1. Trigger generation
curl -X POST https://api.voicgen.io/v1/audio/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: vg_live_your_key_here" \
-d '{
"post_id": "my-article-001",
"post_title": "The future of developer tools",
"post_url": "https://yourblog.com/future-dev-tools",
"content": "<p>The future of software development is being shaped by a new wave of tools...</p>"
}'
Using the WordPress plugin?If you are on WordPress, use the WordPress plugin instead — it handles generation, polling, and player injection automatically. The REST API is for custom CMS integrations.