Verging AI API Documentation
Integrate Verging AI services into your applications. All endpoints are available at https://verging.ai/api/v1
Our RESTful API gives you programmatic access to the same AI tools available on our platform: video face swap, 4K video enhancement, background removal, plus AI proxy services for image generation, chat completions, text-to-speech, speech-to-text, and vision analysis.
Authentication
All API requests require an API key. Include it in the Authorization header:
Authorization: ApiKey vrg_sk_your_api_key_hereGenerate API keys from your account dashboard at verging.ai (click your avatar β API Keys). The full key is shown only once at creation β store it securely.
π Never share your API key or commit it to version control. If compromised, delete it immediately from your dashboard and create a new one.
Credits & Pricing
All services are billed using credits. Purchase credits at $10 = 530 credits.
| Service | Pricing |
|---|---|
| Face Swap | 1 credit/sec (normal), 3 credits/sec (HD) |
| Video Enhancement | 3 credits/sec (normal), 5 credits/sec (HD) |
| Image to Video | 3 credits/sec (normal), 5 credits/sec (HD) |
| Background Removal | 1 credit (fixed) |
| Image Generation | 3 credits (standard), 5 credits (HD) |
| Chat | 1 credit/10K input tokens, 2 credits/10K output tokens (min 1) |
| Text-to-Speech | 2 credits/1K characters (min 1) |
| Speech-to-Text | 1 credit/minute (min 1) |
| Vision | 1 credit base + 1/10K input tokens + 2/10K output tokens |
Error Handling
All errors follow a consistent JSON format:
{
"error_code": 40001,
"message": "Insufficient credits. Required: 5, available: 2",
"upstream_error": null
}| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | 40000 | Bad request / invalid parameters |
| 401 | β | Invalid or missing authentication |
| 402 | 40001 | Insufficient credits |
| 429 | β | Rate limit exceeded |
| 502 | β | Upstream provider error |
| 503 | β | Service unavailable / timeout |
Rate Limits
AI Proxy services are rate-limited per user. When rate-limited, the response includes a 429 status code. Check the X-RateLimit-Reset header for when you can retry.
Face Swap
VideoSwap faces in videos with AI precision. Supports HD processing and async job tracking. Try it online β
Create Job
/api/v1/faceswap/create-jobContent-Type: multipart/form-data
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| swap_image | file | Yes | β | Face image to swap onto the video |
| file_name | string | Yes | β | Original filename |
| target_video_url | string | Yes | β | URL of the target video (uploaded to CDN first) |
| user_video_duration | float | Yes | β | Video duration in seconds |
| job_type | string | No | face-swap | Job type identifier |
| is_hd | boolean | No | false | Enable HD processing (3x credits) |
curl -X POST https://verging.ai/api/v1/faceswap/create-job \
-H "Authorization: ApiKey vrg_sk_xxx" \
-F "swap_image=@face.jpg" \
-F "file_name=video.mp4" \
-F "target_video_url=https://cdn.verging.ai/uploads/video.mp4" \
-F "user_video_duration=30" \
-F "is_hd=false"Response includes job_id. Poll the jobs endpoint for status updates.
List Jobs
/api/v1/faceswap/jobs| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| status | string | No | β | Filter by status (pending, processing, completed, failed) |
| job_ids | string | No | β | Comma-separated job IDs to query |
Retry Failed Job
/api/v1/faceswap/retry-job/{job_id}Only failed jobs can be retried. Credits are re-frozen for the retry.
Video Enhancement
VideoUpscale video quality to high resolution using AI. Async job-based processing. Try it online β
Create Job
/api/v1/video-enhance/create-jobContent-Type: multipart/form-data
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| file_name | string | Yes | β | Original filename |
| target_video_url | string | Yes | β | URL of the video to enhance |
| user_video_duration | float | Yes | β | Video duration in seconds |
| job_type | string | No | video-enhance | Job type identifier |
| is_hd | boolean | No | false | Enable HD upscaling (5 credits/sec) |
curl -X POST https://verging.ai/api/v1/video-enhance/create-job \
-H "Authorization: ApiKey vrg_sk_xxx" \
-F "file_name=video.mp4" \
-F "target_video_url=https://cdn.verging.ai/uploads/video.mp4" \
-F "user_video_duration=15"Background Removal
ImageRemove image backgrounds with AI. Fixed cost of 1 credit per image. Try it online β
Create Job
/api/v1/background-removal/create-jobContent-Type: multipart/form-data
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image | file | Yes | β | Image file (jpg, jpeg, png, webp, max 10MB) |
| file_name | string | Yes | β | Original filename |
| job_type | string | No | background-removal | Job type identifier |
curl -X POST https://verging.ai/api/v1/background-removal/create-job \
-H "Authorization: ApiKey vrg_sk_xxx" \
-F "image=@photo.jpg" \
-F "file_name=photo.jpg"Image Generation
AI ProxyGenerate AI images using DALL-E / gpt-image-1.
/api/v1/ai/imagegen| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | β | Text description of the image to generate |
| model | string | No | gpt-image-1 | Model to use |
| size | string | No | 1024x1024 | Image dimensions |
| quality | string | No | auto | Image quality (auto, standard, hd) |
| n | int | No | 1 | Number of images (1β4) |
curl -X POST https://verging.ai/api/v1/ai/imagegen \
-H "Authorization: ApiKey vrg_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic cityscape at sunset, digital art style",
"quality": "hd",
"n": 2
}'Response
{
"images": [
"https://cdn.verging.ai/proxy/imagegen/abc123.png"
],
"credits_consumed": 3
}Chat / Text Generation
AI ProxyGenerate chat completions using GPT-4o. Supports streaming (SSE) and non-streaming responses. Requires minimum 5 credits balance.
/api/v1/ai/chat| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| messages | array | Yes | β | Array of {role, content} message objects |
| model | string | No | gpt-4o | Model to use |
| temperature | float | No | β | Sampling temperature (0β2) |
| max_tokens | int | No | β | Maximum tokens in response |
| stream | boolean | No | false | Enable SSE streaming |
Non-streaming
curl -X POST https://verging.ai/api/v1/ai/chat \
-H "Authorization: ApiKey vrg_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in one paragraph."}
],
"temperature": 0.7,
"max_tokens": 256
}'Streaming (SSE)
curl -N -X POST https://verging.ai/api/v1/ai/chat \
-H "Authorization: ApiKey vrg_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "Write a haiku about coding."}],
"stream": true
}'Response (non-streaming)
{
"content": "Quantum computing leverages quantum mechanical phenomena...",
"usage": {
"prompt_tokens": 24,
"completion_tokens": 85,
"total_tokens": 109
},
"credits_consumed": 1
}Streaming responses use Server-Sent Events. Each chunk: data: {"content": "..."}. Final chunk includes usage and credits_consumed, followed by data: [DONE].
Text-to-Speech
AI ProxyConvert text to speech audio using OpenAI TTS-1-HD.
/api/v1/ai/tts| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| input | string | Yes | β | Text to convert (max 4096 characters) |
| voice | string | No | alloy | Voice: alloy, echo, fable, onyx, nova, shimmer |
| model | string | No | tts-1-hd | TTS model |
| response_format | string | No | mp3 | Audio format |
| speed | float | No | 1.0 | Playback speed (0.25β4.0) |
curl -X POST https://verging.ai/api/v1/ai/tts \
-H "Authorization: ApiKey vrg_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"input": "Hello! Welcome to Verging AI.",
"voice": "nova",
"speed": 1.1
}'Response
{
"audio_url": "https://cdn.verging.ai/proxy/tts/abc123.mp3",
"credits_consumed": 1
}Speech-to-Text
AI ProxyTranscribe audio to text using OpenAI Whisper. Supports mp3, mp4, mpeg, mpga, m4a, wav, webm (max 25MB).
/api/v1/ai/sttContent-Type: multipart/form-data
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| file | file | Yes | β | Audio file to transcribe |
| model | string | No | whisper-1 | STT model |
| language | string | No | β | Language code (en, zh, ja, etc.) |
| response_format | string | No | json | Output format |
| temperature | float | No | β | Sampling temperature (0β1) |
curl -X POST https://verging.ai/api/v1/ai/stt \
-H "Authorization: ApiKey vrg_sk_xxx" \
-F "file=@recording.mp3" \
-F "language=en"Response
{
"text": "Hello, this is a sample transcription.",
"language": "en",
"duration": 12.5,
"credits_consumed": 1
}Vision Analysis
AI ProxyAnalyze images using GPT-4o Vision. Supports image URL and file upload. Requires minimum 5 credits balance.
Option A β Image URL
/api/v1/ai/vision| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | β | Analysis instruction / question |
| image_url | string | Yes | β | URL of the image (png, jpeg, gif, webp) |
| model | string | No | gpt-4o | Vision model |
| max_tokens | int | No | 1024 | Max tokens in response |
curl -X POST https://verging.ai/api/v1/ai/vision \
-H "Authorization: ApiKey vrg_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Describe what you see in this image.",
"image_url": "https://example.com/photo.jpg"
}'Option B β File Upload
/api/v1/ai/vision/uploadcurl -X POST https://verging.ai/api/v1/ai/vision/upload \
-H "Authorization: ApiKey vrg_sk_xxx" \
-F "prompt=What objects are in this image?" \
-F "file=@photo.jpg"Response
{
"content": "The image shows a modern office space with several desks...",
"usage": {
"prompt_tokens": 1100,
"completion_tokens": 95,
"total_tokens": 1195
},
"credits_consumed": 2
}Usage Query
AccountQuery your AI proxy service usage history.
/api/v1/ai/usage| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| service_type | string | No | β | Filter by service (imagegen, chat, tts, stt, vision) |
| page | int | No | 1 | Page number |
| page_size | int | No | 20 | Records per page (max 100) |
curl https://verging.ai/api/v1/ai/usage \
-H "Authorization: ApiKey vrg_sk_xxx"Response
{
"records": [
{
"id": 1,
"service_type": "chat",
"credits_consumed": 3,
"input_tokens": 24,
"output_tokens": 85,
"latency_ms": 1200,
"status": "success",
"created_at": "2026-03-20T10:30:00"
}
],
"total": 17,
"page": 1,
"page_size": 20
}API Key Management
AccountManage your API keys. Create new keys from your account dashboard at verging.ai (avatar β API Keys). Keys use the prefix vrg_sk_.
List API Keys
/api/v1/api-keysReturns your API keys (prefix only, never the full key).
Delete API Key
/api/v1/api-keys/{id}Permanently revokes the specified API key.
Validate API Key
/api/v1/api-keys/validateTest if your API key is valid and active.
curl -X POST https://verging.ai/api/v1/api-keys/validate \
-H "Authorization: ApiKey vrg_sk_xxx"