Skip to content
واجهة برمجة التطبيقات للمطورين

واجهة برمجة تطبيقات AMPX

أتمت تحويل الملفات ومهام الأدوات ومعالجة النتائج عبر REST API واضح.

POST /api/convert

API access is a paid add-on

Choose Starter, Basic or Pro, then add the API key to that same monthly Stripe subscription. The API uses the same account credit pool and rate limit as the web tools.

Conversion API workflow

URL downloads start at step 2. File converters first reserve and upload files with tus.

One Bearer key · shared plan limits
1
Allocate and upload files

POST /api/uploads, then tus upload to the returned upload_url. Required only for imagick, esrgan, video_convert, audio_convert, archive, pandoc.

2
Submit the operation

Send POST /api/convert with a service type and either a source URL or the allocated upload data.

3
Poll owned job status

Call GET /api/status?token=... until the state is finished, failed or cancelled. The token is scoped to the API key that created it.

4
Download the result

Use the returned download_url or GET /d/{token}. Unit and text utilities return synchronously and skip status polling.

Starter

Credits / billing cycle10,000
Rate limit10/min
API keySeparate paid add-on

Basic

Credits / billing cycle25,000
Rate limit30/min
API keySeparate paid add-on

Pro

Credits / billing cycle60,000
Rate limit60/min
API keySeparate paid add-on

Available services and credit prices

Credits are charged only when an operation succeeds. Failed or cancelled jobs release their reservation. File operations add the shown size charge per started 10 MB of final output.

ServiceTypeBase creditsFinal-size chargeStatus
Video download
Download video from YouTube, TikTok, Reddit, Instagram, Facebook, Twitch, X, Vimeo or another supported source.
job 12 +1 / started 10 MB Available
Audio download
Extract audio from a supported media URL.
job 8 +1 / started 10 MB Available
Image converter and bulk editor
Convert, resize, crop, rotate and edit one or more uploaded images.
job 5 +1 / started 10 MB Available
Audio converter
Convert an uploaded audio file.
job 5 +1 / started 10 MB Available
Video converter
Convert an uploaded video with an allowlisted FFmpeg preset for YouTube, Instagram Reels or TikTok Shorts.
job 12 +1 / started 10 MB Temporarily disabled
Archive converter
Create or convert an uploaded archive.
job 5 +1 / started 10 MB Available
Document converter
Convert a supported uploaded document with Pandoc.
job 5 +1 / started 10 MB Temporarily disabled
AI image upscaler
Upscale an uploaded image with a supported ESRGAN model.
job 25 +1 / started 10 MB Available
Proxy checker
Check a batch of HTTP, HTTPS or SOCKS proxies.
job 1 / 5 items None Available
Unit converter
Synchronous Unit converter operation.
utility 1 None Available
Text utilities
Synchronous Text utilities operation.
utility 1 None Available

Authentication

Send the key as a Bearer token. It is shown only once when created or rotated.

Authorization: Bearer ampx_live_...

Limits and charging

The key uses the same credits and operations/minute limit as the web account. A successful utility is charged immediately; an asynchronous job reserves credits and settles them after completion.

Machine-readable docs

Fetch the authenticated OpenAPI 3.1 document with the same Bearer header.

GET https://ampx.cc/api/openapi.json

Service reference

All API operations and required fields are listed below. Add Idempotency-Key when retrying a request.

POST /api/uploads — allocate file uploads

For imagick, esrgan, video_convert, audio_convert, archive, pandoc, first allocate one or more filenames. Upload each file with tus to the returned upload_url, preserving the returned file metadata. Then submit the returned token, or files[].relative_path and worker for Pandoc, to /api/convert.

curl -X POST 'https://ampx.cc/api/uploads' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"mode":"imagick","filenames":["input.png"]}'
{
  "ok": true,
  "data": {
    "token": "UPLOAD_TOKEN",
    "worker": "worker1",
    "files": [{"name": "input.png", "relative_path": "UPLOAD_TOKEN/input.png"}],
    "upload_url": "https://worker.example/api/upload/tus",
    "protocol": "tus"
  }
}

Upload with tus 1.0: create the upload resource at upload_url. Both token and filename in Upload-Metadata are base64-encoded values. The response returns the resumable resource URL in its Location header.

curl -i -X POST '<UPLOAD_URL>' \ -H 'Tus-Resumable: 1.0.0' \ -H 'Upload-Length: <FILE_SIZE_BYTES>' \ -H 'Upload-Metadata: token <BASE64_UPLOAD_TOKEN>,filename <BASE64_FILENAME>'

Upload bytes to that Location. If a transfer resumes, obtain the current offset with a tus HEAD request and send that value as Upload-Offset.

curl -X PATCH '<LOCATION_FROM_POST>' \ -H 'Tus-Resumable: 1.0.0' \ -H 'Content-Type: application/offset+octet-stream' \ -H 'Upload-Offset: 0' \ --data-binary '@input.png'
POST /api/convert — Video download

Download video from YouTube, TikTok, Reddit, Instagram, Facebook, Twitch, X, Vimeo or another supported source. Base price: 12 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
urlstring|required
formatstring|optional
qualitystring|optional
fpsinteger|optional
playlistboolean|optional
source_servicestring|optional
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"video","url":"https://www.youtube.com/watch?v=VIDEO_ID","format":"mp4","quality":"1080p","playlist":false,"source_service":"youtube"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Audio download

Extract audio from a supported media URL. Base price: 8 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
urlstring|required
formatmp3|m4a|flac|aac
qualitystring|optional
playlistboolean|optional
source_servicestring|optional
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"audio","url":"https://soundcloud.com/artist/track","format":"mp3","quality":"320","playlist":false,"source_service":"soundcloud"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Image converter and bulk editor

Convert, resize, crop, rotate and edit one or more uploaded images. Base price: 5 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
tokenstring|required (from POST /api/uploads)
output_formatstring|required
operationsobject|optional (auto_orient, trim, strip, quality, rotate, flip, flop, invert, resize, fit or pad)
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"imagick","token":"UPLOAD_TOKEN","output_format":"webp","operations":{"auto_orient":true,"invert":true,"resize":"1920x1080>","quality":85}}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Audio converter

Convert an uploaded audio file. Base price: 5 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
tokenstring|required (from POST /api/uploads)
output_formatstring|required
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"audio_convert","token":"UPLOAD_TOKEN","output_format":"mp3"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Video converter

Convert an uploaded video with an allowlisted FFmpeg preset for YouTube, Instagram Reels or TikTok Shorts. Base price: 12 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
tokenstring|required (from POST /api/uploads)
output_formatmp4|webm|required
presetyoutube|instagram_reels|tiktok_shorts|generic_mp4|generic_webm|optional
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"video_convert","token":"UPLOAD_TOKEN","output_format":"mp4","preset":"youtube"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Archive converter

Create or convert an uploaded archive. Base price: 5 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
tokenstring|required (from POST /api/uploads)
output_formatstring|required
max_output_bytesinteger|optional
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"archive","token":"UPLOAD_TOKEN","output_format":"zip"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Document converter

Convert a supported uploaded document with Pandoc. Base price: 5 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
input_pathstring|required (files[].relative_path returned by POST /api/uploads)
from_formatstring|required
to_formatstring|required
workerstring|required (from POST /api/uploads)
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"pandoc","input_path":"UPLOAD_TOKEN/document.docx","from_format":"docx","to_format":"pdf","worker":"worker1"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — AI image upscaler

Upscale an uploaded image with a supported ESRGAN model. Base price: 25 credit(s), plus 1 credit(s) per started 10 MB of final output.

FieldType / requirement
typestring|required
tokenstring|required (from POST /api/uploads)
modelstring|optional
scaleinteger|optional (2-4)
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"esrgan","token":"UPLOAD_TOKEN","model":"realesrgan-x4plus","scale":4}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/convert — Proxy checker

Check a batch of HTTP, HTTPS or SOCKS proxies. Base price: 1 credit(s).

FieldType / requirement
typestring|required
proxiesarray|required
default_protocolstring|optional
timeout_secinteger|optional
connect_timeout_secinteger|optional
test_urlurl|optional
curl -X POST 'https://ampx.cc/api/convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"type":"proxy_check","proxies":["http://127.0.0.1:8080","socks5://127.0.0.1:1080"],"default_protocol":"http","timeout_sec":15,"connect_timeout_sec":5,"test_url":"https://example.com/"}'

A successful submission returns token, state, status_url, download_url and the reserved credit amount.

POST /api/utilities/unit-convert — Unit converter

Synchronous Unit converter operation. Base price: 1 credit(s).

FieldType / requirement
categorystring|required
fromstring|required
tostring|required
valuenumber|required
precisioninteger|optional
curl -X POST 'https://ampx.cc/api/utilities/unit-convert' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"category":"length","from":"m","to":"ft","value":10,"precision":4}'

This utility responds synchronously with its result and charged usage.

POST /api/utilities/text — Text utilities

Synchronous Text utilities operation. Base price: 1 credit(s).

FieldType / requirement
textstring|required
operationsarray|optional
curl -X POST 'https://ampx.cc/api/utilities/text' \ -H 'Authorization: Bearer <AMPX_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{"text":"Convert this title","operations":["uppercase","slug"]}'

This utility responds synchronously with its result and charged usage.

Status and download example

Poll only the status_url returned for your job. When its state is finished and ready is true, follow download_url; failed and cancelled jobs release their reserved credits.

curl 'https://ampx.cc/api/status?token=JOB_TOKEN' \ -H 'Authorization: Bearer <AMPX_API_KEY>'
{
  "ok": true,
  "data": {
    "token": "JOB_TOKEN",
    "state": "finished",
    "ready": true,
    "download_url": "https://ampx.cc/d/JOB_TOKEN"
  }
}

Error contract

Errors use {"ok":false,"error":{"code":"…","message":"…"}}. Access requires an effective paid plan plus the separate API add-on, or an administrator grant with API access enabled.

CodeHTTP
bearer_token_missing401
invalid_api_key403
paid_plan_required403
api_addon_required403
billing_not_active403
rate_limit_exceeded429
upload_too_large413
credits_exhausted429
idempotency_conflict409
invalid_request422
scope_not_allowed403
service_disabled503
Site status Checking...