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. You can also use our agent skills to run these tools directly from your terminal.
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"Agent Skills β CLI Quick Start
CLIUse Verging AI directly from your terminal with agent skills. Each skill wraps our API into a single command β no code needed. Skills work with Claude Code and compatible AI coding agents.
Prerequisites
1. A Verging AI API key (see Authentication above)
2. Set your API key as an environment variable:
export VERGING_API_KEY="vrg_sk_your_key_here"Install a Skill
Skills are installed via the OpenClaw registry. Each skill is a single command:
# Install face swap skill
npx openclaw add verging-ai/faceswap
# Install video enhancement skill
npx openclaw add verging-ai/video-enhancement
# Install background removal skill
npx openclaw add verging-ai/background-removalAll 8 skills are available at github.com/verging-ai/agent-skills.
Face Swap CLI
SkillSwap faces in videos from your terminal. Supports local files, YouTube/Bilibili URLs, time trimming, and HD mode.
# Basic usage β local video + local face image
/faceswap -v ./input.mp4 -f ./my-face.jpg
# Remote video from YouTube
/faceswap -v "https://youtube.com/watch?v=xxx" -f ./face.jpg --hd
# Trim to specific time range (saves credits)
/faceswap -v ./video.mp4 -f ./face.jpg --start 5 --end 15
# Auto-download result to current directory
/faceswap -v ./video.mp4 -f ./face.jpg --download| Option | Short | Description |
|---|---|---|
| --video | -v | Video file path or URL (required) |
| --face | -f | Face image file path or URL (required) |
| --hd | -h | HD mode (3 credits/sec vs 1 credit/sec) |
| --start | -s | Start time in seconds |
| --end | -e | End time in seconds |
| --download | -d | Auto-download result to local |
| --output | -o | Custom output path |
Requires yt-dlp for remote video URLs. ffmpeg for time trimming.
Video Enhancement CLI
SkillUpscale and enhance video quality from your terminal. Restore old footage, sharpen low-res videos, upscale to HD/4K.
# Enhance a local video
/video-enhancement -v ./old-video.mp4
# HD mode for maximum quality
/video-enhancement -v ./clip.mp4 --hd
# Enhance a specific segment from YouTube
/video-enhancement -v "https://youtube.com/watch?v=xxx" --start 5 --end 15 --hd
# Download result automatically
/video-enhancement -v ./video.mp4 --downloadNormal mode: 1 credit/sec. HD mode: 3 credits/sec. Max 30 seconds per video.
Background Removal CLI
SkillRemove image backgrounds with one command. Outputs transparent PNG. Great for product photos, headshots, and design assets.
# Remove background from local image
/background-removal -i ./photo.jpg
# From a remote URL
/background-removal -i "https://example.com/product.jpg"
# Save to specific path
/background-removal -i ./photo.jpg -o ./transparent.pngFixed cost: 1 credit per image. Supports JPG, PNG, WebP (max 10MB).
More Skills
AI ProxyIn addition to the core video and image skills above, Verging AI offers CLI skills for all AI proxy services. These use the same API key and credit system.
| Skill | Command | Description |
|---|---|---|
| imagegen | /imagegen -p "a sunset over mountains" | Generate images from text prompts (DALL-E / gpt-image-1) |
| chat | /chat -m "Explain Docker" | LLM chat completions (GPT-4o), streaming supported |
| tts | /tts -t "Hello world" -v nova | Text-to-speech with 6 voice options |
| stt | /stt -f ./audio.mp3 | Speech-to-text transcription (Whisper) |
| vision | /vision -i ./photo.jpg -p "Describe this" | Image analysis with GPT-4o Vision |
All skills follow the same pattern: install via npx openclaw add verging-ai/<skill-name>, set VERGING_API_KEY, and run the command. Full documentation for each skill is available in the GitHub repository.