Verging

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_here

Generate 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.

ServicePricing
Face Swap1 credit/sec (normal), 3 credits/sec (HD)
Video Enhancement3 credits/sec (normal), 5 credits/sec (HD)
Image to Video3 credits/sec (normal), 5 credits/sec (HD)
Background Removal1 credit (fixed)
Image Generation3 credits (standard), 5 credits (HD)
Chat1 credit/10K input tokens, 2 credits/10K output tokens (min 1)
Text-to-Speech2 credits/1K characters (min 1)
Speech-to-Text1 credit/minute (min 1)
Vision1 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 StatusError CodeDescription
40040000Bad request / invalid parameters
401β€”Invalid or missing authentication
40240001Insufficient 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

Video

Swap faces in videos with AI precision. Supports HD processing and async job tracking. Try it online β†’

Create Job

POST/api/v1/faceswap/create-job

Content-Type: multipart/form-data

ParameterTypeRequiredDefaultDescription
swap_imagefileYesβ€”Face image to swap onto the video
file_namestringYesβ€”Original filename
target_video_urlstringYesβ€”URL of the target video (uploaded to CDN first)
user_video_durationfloatYesβ€”Video duration in seconds
job_typestringNoface-swapJob type identifier
is_hdbooleanNofalseEnable 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

GET/api/v1/faceswap/jobs
ParameterTypeRequiredDefaultDescription
statusstringNoβ€”Filter by status (pending, processing, completed, failed)
job_idsstringNoβ€”Comma-separated job IDs to query

Retry Failed Job

POST/api/v1/faceswap/retry-job/{job_id}

Only failed jobs can be retried. Credits are re-frozen for the retry.

✨

Video Enhancement

Video

Upscale video quality to high resolution using AI. Async job-based processing. Try it online β†’

Create Job

POST/api/v1/video-enhance/create-job

Content-Type: multipart/form-data

ParameterTypeRequiredDefaultDescription
file_namestringYesβ€”Original filename
target_video_urlstringYesβ€”URL of the video to enhance
user_video_durationfloatYesβ€”Video duration in seconds
job_typestringNovideo-enhanceJob type identifier
is_hdbooleanNofalseEnable 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

Image

Remove image backgrounds with AI. Fixed cost of 1 credit per image. Try it online β†’

Create Job

POST/api/v1/background-removal/create-job

Content-Type: multipart/form-data

ParameterTypeRequiredDefaultDescription
imagefileYesβ€”Image file (jpg, jpeg, png, webp, max 10MB)
file_namestringYesβ€”Original filename
job_typestringNobackground-removalJob 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 Proxy

Generate AI images using DALL-E / gpt-image-1.

POST/api/v1/ai/imagegen
ParameterTypeRequiredDefaultDescription
promptstringYesβ€”Text description of the image to generate
modelstringNogpt-image-1Model to use
sizestringNo1024x1024Image dimensions
qualitystringNoautoImage quality (auto, standard, hd)
nintNo1Number 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 Proxy

Generate chat completions using GPT-4o. Supports streaming (SSE) and non-streaming responses. Requires minimum 5 credits balance.

POST/api/v1/ai/chat
ParameterTypeRequiredDefaultDescription
messagesarrayYesβ€”Array of {role, content} message objects
modelstringNogpt-4oModel to use
temperaturefloatNoβ€”Sampling temperature (0–2)
max_tokensintNoβ€”Maximum tokens in response
streambooleanNofalseEnable 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 Proxy

Convert text to speech audio using OpenAI TTS-1-HD.

POST/api/v1/ai/tts
ParameterTypeRequiredDefaultDescription
inputstringYesβ€”Text to convert (max 4096 characters)
voicestringNoalloyVoice: alloy, echo, fable, onyx, nova, shimmer
modelstringNotts-1-hdTTS model
response_formatstringNomp3Audio format
speedfloatNo1.0Playback 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 Proxy

Transcribe audio to text using OpenAI Whisper. Supports mp3, mp4, mpeg, mpga, m4a, wav, webm (max 25MB).

POST/api/v1/ai/stt

Content-Type: multipart/form-data

ParameterTypeRequiredDefaultDescription
filefileYesβ€”Audio file to transcribe
modelstringNowhisper-1STT model
languagestringNoβ€”Language code (en, zh, ja, etc.)
response_formatstringNojsonOutput format
temperaturefloatNoβ€”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 Proxy

Analyze images using GPT-4o Vision. Supports image URL and file upload. Requires minimum 5 credits balance.

Option A β€” Image URL

POST/api/v1/ai/vision
ParameterTypeRequiredDefaultDescription
promptstringYesβ€”Analysis instruction / question
image_urlstringYesβ€”URL of the image (png, jpeg, gif, webp)
modelstringNogpt-4oVision model
max_tokensintNo1024Max 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

POST/api/v1/ai/vision/upload
curl -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

Account

Query your AI proxy service usage history.

GET/api/v1/ai/usage
ParameterTypeRequiredDefaultDescription
service_typestringNoβ€”Filter by service (imagegen, chat, tts, stt, vision)
pageintNo1Page number
page_sizeintNo20Records 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

Account

Manage 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

GET/api/v1/api-keys

Returns your API keys (prefix only, never the full key).

Delete API Key

DELETE/api/v1/api-keys/{id}

Permanently revokes the specified API key.

Validate API Key

POST/api/v1/api-keys/validate

Test 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"