Our API is OpenAI Compatible, which means that you can plug it into hundreds of third party tools like Claude Code and OpenWebUI, even with non-OpenAI models. To check on costs, see Account Activity.
For questions or support, please use the chat widget in the bottom right!
For AI agents and coding assistants, see our llms.txt.
No API keys found. Create your first API key
https://api.ppq.aiThis is the URL you want to set if plugging into a third party tool or software
POST https://api.ppq.ai/chat/completionsThis is the URL you want to set if you are calling our Chat API from custom code you've written.
Model Name | Model ID | Provider | Max Context | Date Added | Input Rate | Output Rate | Average Cost | Prompts / $1 |
|---|---|---|---|---|---|---|---|---|
| No models available | ||||||||
Model Name | Model ID | Provider | Max Context | Date Added | Input Rate | Output Rate | Average Cost | Prompts / $1 |
|---|---|---|---|---|---|---|---|---|
| No models available | ||||||||
A list of our current models, model attributes, and pricing.
import requests
url = "https://api.ppq.ai/v1/models"
response = requests.get(url)
print(response.json())import requests
api_key = "YOUR_API_KEY"
url = "https://api.ppq.ai/chat/completions"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
data = {
"model": "claude-3.5-sonnet",
"messages": [{"role": "user", "content": "Hello, how are you?"}]
}
response = requests.post(url, json=data, headers=headers)
print(response.json())Any model can be given real-time web access by including a plugins array in your request. Before your query reaches the AI model, a web search is performed and the results are injected into the prompt, giving the model real-time context to work with.
plugins array to your request body with the web plugin:id*Plugin identifier. Use "web" for web search.max_resultsNumber of web search results to retrieve and inject into the model's context (default: 5). More results provide broader context but increase token usage.The search engine used depends on the model:
curl -X POST https://api.ppq.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer null" \
-d '{
"model": "claude-sonnet-4-5",
"plugins": [{"id": "web", "max_results": 5}],
"messages": [{"role": "user", "content": "What is the weather in Omaha, Nebraska right now?"}]
}'Convert audio to text using our OpenAI-compatible transcription API. Powered by Deepgram Nova-3 for high-quality, accurate transcriptions.
POST https://ppq.ai/api/v1/audio/transcriptionsmp3, mp4, mpeg, mpga, m4a, wav, webm (max 25MB)
file*The audio file to transcribemodelModel to use: "nova-3" (default) or "nova-2"response_formatFormat: json, text, srt, vtt, or verbose_json (default: json)languageLanguage code (e.g., "en", "es", "fr") or "multi" for auto-detectpromptOptional text to guide the model's stylefrom openai import OpenAI
# Initialize client with PayPerQ API
client = OpenAI(
api_key="null",
base_url="https://ppq.ai/api/v1"
)
# Transcribe audio file
with open("audio.mp3", "rb") as audio_file:
transcription = client.audio.transcriptions.create(
model="nova-3", # Deepgram Nova-3
file=audio_file,
response_format="json" # Options: json, text, srt, vtt, verbose_json
)
print(transcription.text)Convert text to natural-sounding speech using our OpenAI-compatible TTS API. Powered by DeepGram Aura for high-quality voice synthesis.
POST https://ppq.ai/api/v1/audio/speechinput*The text to convert to speech (max 2000 characters)modelModel to use: "deepgram_aura_2" (default)voiceDeepGram Aura voice ID (default: aura-2-arcas-en)aura-2-arcas-enArcas - Natural, Smooth, Clearaura-2-thalia-enThalia - Clear, Confident, Energeticaura-2-andromeda-enAndromeda - Casual, Expressiveaura-2-helena-enHelena - Caring, Natural, Friendlyaura-2-apollo-enApollo - Confident, Comfortableaura-2-aries-enAries - Warm, Energetic, Caringfrom openai import OpenAI
# Initialize client with PayPerQ API
client = OpenAI(
api_key="null",
base_url="https://ppq.ai/api/v1"
)
# Generate speech from text
response = client.audio.speech.create(
model="deepgram_aura_2",
voice="aura-2-arcas-en", # Natural, Smooth, Clear
input="Hello, welcome to PayPerQ!"
)
# Save to file
response.stream_to_file("output.mp3")Generate images from text prompts or transform existing images using state-of-the-art AI models. Requests are synchronous — the API returns the generated images directly in the response.
POST https://api.ppq.ai/v1/images/generationsmodel*The model to use for generation (see Available Models below)prompt*A text description of the image to generatenNumber of images to generate, 1–10 (default: 1)qualityQuality tier — varies by model (e.g. "low", "medium", "high", "1k", "2k")sizeImage size or aspect ratio (e.g. "1:1", "16:9"). Model-specific.image_urlSource image URL for image-to-image models (e.g. flux-2-pro-i2i)gpt-image-1GPT Image 1 (4o) — quality: low, medium, highgpt-image-1.5GPT Image 1.5 — quality: medium, highnano-banana-proGemini 3.0 — quality: standard, 4kflux-2-proFlux 2 Pro — quality: 1k, 2kflux-2-flexFlux 2 Flex — quality: 1k, 2kflux-2-pro-i2iFlux 2 Pro (Image-to-Image) — requires image_urlflux-kontext-proFlux Kontext Pro — flat pricingflux-kontext-maxFlux Kontext Max — flat pricingGET /v1/media/models to see all available models and current pricing.{
"created": 1709234567,
"model": "gpt-image-1",
"cost": 0.0805,
"data": [
{
"url": "https://api.ppq.ai/v1/media/gen_abc123/0?sig=...&exp=...",
"content_type": "image/png"
}
]
}import requests
api_key = "YOUR_API_KEY"
url = "https://api.ppq.ai/v1/images/generations"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
data = {
"model": "gpt-image-1",
"prompt": "A futuristic cityscape at sunset",
"quality": "medium",
"n": 1
}
response = requests.post(url, json=data, headers=headers)
result = response.json()
# Each item in data[] has a signed URL
for image in result["data"]:
print(image["url"])Generate videos from text prompts or input images. Video generation is asynchronous — submit a request, then poll for the result. Supports text-to-video and image-to-video models.
POST https://api.ppq.ai/v1/videosmodel*The video model to use (see Available Models below)prompt*A text description of the video to generateaspect_ratioAspect ratio (e.g. "16:9", "9:16", "1:1"). Default: "16:9"durationVideo duration in seconds (e.g. "5", "10"). Model-specific.qualityQuality/resolution tier (e.g. "720p", "1080p"). Model-specific.image_urlA publicly accessible image URL for image-to-video models{
"id": "gen_abc123",
"model": "kling-2.1-pro",
"status": "pending",
"created": 1709234567,
"estimated_cost": 0.2875
}GET https://api.ppq.ai/v1/videos/:idPoll this endpoint every 5–10 seconds until status changes to "completed" or "failed". Returns 202 while processing, 200 when done.
{
"id": "gen_abc123",
"model": "kling-2.1-pro",
"status": "completed",
"created": 1709234567,
"data": {
"url": "https://api.ppq.ai/v1/media/gen_abc123/0?sig=...&exp=...",
"content_type": "video/mp4"
},
"cost": 0.2875
}Text-to-Video
veo3Google Veo 3 (Quality) — 8sveo3-fastGoogle Veo 3 (Fast) — 8ssora-2Sora 2 — 10s, 15ssora-2-proSora 2 Pro — 720p/1080p, 10s/15skling-2.1-proKling 2.6 — 5s, 10skling-2.1-masterKling 2.1 Master — 1080p, 5s/10skling-2.5-turboKling 2.5 Turbo — 5s, 10srunway-gen4Runway Gen-4 — 720p/1080p, 5s/10srunway-alephRunway Aleph — 5s, 10sImage-to-Video
veo3-i2vGoogle Veo 3 I2V — requires image_urlsora-2-i2vSora 2 I2V — 10s, 15ssora-2-pro-i2vSora 2 Pro I2V — 720p/1080pkling-2.1-master-i2vKling 2.1 Master I2V — 5s, 10skling-2.5-turbo-i2vKling 2.5 Turbo I2V — 5s, 10sGET /v1/media/models to see all available models and current pricing.import requests
import time
api_key = "YOUR_API_KEY"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
# Step 1: Submit video generation request
data = {
"model": "kling-2.1-pro",
"prompt": "A golden retriever running through a meadow",
"aspect_ratio": "16:9",
"duration": "5"
}
response = requests.post(
"https://api.ppq.ai/v1/videos",
json=data,
headers=headers
)
job = response.json()
generation_id = job["id"]
print(f"Job submitted: {generation_id}")
# Step 2: Poll for completion
while True:
status_res = requests.get(
f"https://api.ppq.ai/v1/videos/{generation_id}",
headers=headers
)
status = status_res.json()
if status["status"] == "completed":
print(f"Video ready: {status['data']['url']}")
break
elif status["status"] == "failed":
print(f"Error: {status.get('error')}")
break
print("Processing...")
time.sleep(5)import requests
api_key = "YOUR_API_KEY"
generation_id = "gen_abc123"
response = requests.get(
f"https://api.ppq.ai/v1/videos/{generation_id}",
headers={"Authorization": f"Bearer {api_key}"}
)
result = response.json()
print(result)
# {"id": "gen_abc123", "model": "kling-2.1-pro", "status": "completed",
# "data": {"url": "https://api.ppq.ai/v1/media/gen_abc123/0?sig=...&exp=..."},
# "cost": 0.2875}The PayPerQ API allows users to programmatically create deposit invoices and top up their account balances using various payment methods including Bitcoin (Lightning), Bitcoin (on-chain), Monero, Litecoin, and Liquid Bitcoin.
Create a topup invoice for the specified payment method.
Methods: btc-lightning, btc, ltc, lbtc, xmr
curl -X POST https://api.ppq.ai/topup/create/btc-lightning \
-H "Authorization: Bearer null" \
-H "Content-Type: application/json" \
-d '{"amount": 1000, "currency": "SATS"}' # Also supports "BTC" and "USD" as currencyCheck the status of a topup invoice.
curl -X GET https://api.ppq.ai/topup/status/BTCPayInvoiceId123 \
-H "Authorization: Bearer null"Get a list of all supported payment methods with their limits and supported currencies.
curl -X GET https://api.ppq.ai/topup/payment-methodsCreate a new account, which returns a new credit_id and an api_key.
curl -X POST https://api.ppq.ai/accounts/createGet the current credit balance for your account.
curl -X POST "https://api.ppq.ai/credits/balance" \
-H "Content-Type: application/json" \
-d '{"credit_id":"4af59b9d-f6ec-4531-82f7-ce776d49e207"}'curl -X POST https://api.ppq.ai/topup/create/btc \
-H "api-key: null" \
-H "Content-Type: application/json" \
-d '{"amount": 0.001, "currency": "BTC"}'curl -X POST https://api.ppq.ai/topup/create/xmr \
-H "Authorization: Bearer null" \
-H "Content-Type: application/json" \
-d '{"amount": 50.00, "currency": "USD"}'Connect a Nostr Wallet Connect (NWC) compatible Lightning wallet to automatically top up your balance when it falls below a threshold. Your wallet needs to support the pay_invoice capability. Compatible wallets include Alby Hub, LNBits, Primal, and others.
Connect an NWC wallet for automatic top-ups. Requires x-credit-id header.
nwc_url (required) — Your NWC connection stringthreshold_usd (optional, default: 10, min: 5) — Balance threshold to trigger top-uptopup_amount_usd (optional, default: 10) — Amount to top up each timecurl -X POST "https://api.ppq.ai/nwc-auto-topup/connect" \
-H "Content-Type: application/json" \
-H "x-credit-id: YOUR_CREDIT_ID" \
-d '{
"nwc_url": "nostr+walletconnect://your-wallet-pubkey?relay=wss://relay.example.com&secret=your-secret",
"threshold_usd": 5,
"topup_amount_usd": 10
}'Get current NWC auto-topup settings. Requires x-credit-id header.
curl -X GET "https://api.ppq.ai/nwc-auto-topup" \
-H "x-credit-id: YOUR_CREDIT_ID"Disconnect your NWC wallet and disable auto-topup. Requires x-credit-id header.
curl -X DELETE "https://api.ppq.ai/nwc-auto-topup/connection" \
-H "x-credit-id: YOUR_CREDIT_ID"Manage your API keys programmatically. Create keys with optional spending limits, reset periods, and expiration dates. All endpoints require the x-credit-id header for authentication.
Base URL: https://api.ppq.ai
List all API keys for your account.
include_disabledInclude revoked keys in the response (default: false)show_keyInclude the full api_key value in the response (default: false)status"success"dataArray of API key objects with the following fields:_idMongoDB ObjectId — use this as {id} in other endpointsnameKey nameapi_keyFull key value — only present when show_key=trueusage_limit_usdSpending cap in USD, or null if unlimitedcurrent_period_usage_usdSpending in the current reset periodtotal_usage_all_time_usdTotal spending since key creationreset_period"daily" | "weekly" | "monthly" | nullreset_atNext reset datetime (ISO 8601), or nullexpire_atExpiration datetime (ISO 8601), or nullcreated_atCreation datetime (ISO 8601)updated_atLast update datetime (ISO 8601)deleted_atRevocation datetime (ISO 8601), or null if activecurl -X GET "https://api.ppq.ai/keys" \
-H "x-credit-id: YOUR_CREDIT_ID"Create a new API key. The full key value is only returned once — save it securely.
name*Key name, 1–25 characters, unique per accountusage_limit_usdSpending cap in USD, minimum $0.01. Omit or pass null for unlimitedreset_periodAuto-reset usage counter: "daily", "weekly", or "monthly". Requires usage_limit_usdexpire_atISO 8601 datetime (e.g. 2027-01-01T00:00:00Z), must be in the futurestatus"success"dataCreated key object:_idMongoDB ObjectIdnameKey nameapi_keyFull key value — shown only on creation, store it securelyusage_limit_usdSpending cap, or nullreset_periodReset period, or nullreset_atNext reset datetime, or nullexpire_atExpiration datetime, or nullcreated_atCreation datetime (ISO 8601)curl -X POST "https://api.ppq.ai/keys" \
-H "Content-Type: application/json" \
-H "x-credit-id: YOUR_CREDIT_ID" \
-d '{
"name": "my-app-key",
"usage_limit_usd": 10.00,
"reset_period": "monthly",
"expire_at": "2027-01-01T00:00:00Z"
}'Get details for a single API key by its MongoDB ObjectId.
show_keyInclude the full api_key value in the response (default: false)status"success"dataKey object:_idMongoDB ObjectIdnameKey nameapi_keyFull key value — only present when show_key=truecreated_atCreation datetime (ISO 8601)updated_atLast update datetime (ISO 8601)deleted_atRevocation datetime, or null if activecurl -X GET "https://api.ppq.ai/keys/KEY_ID" \
-H "x-credit-id: YOUR_CREDIT_ID"Update an existing API key. Only include the fields you want to change. Pass null to clear a field (e.g. remove a usage limit).
nameNew key name, 1–25 charactersusage_limit_usdNew spending cap in USD (min $0.01) or null to remove limitreset_period"daily", "weekly", "monthly", or null. Changing this resets current_period_usage_usd to $0expire_atNew expiration datetime (e.g. 2028-06-01T00:00:00Z) or null to removestatus"success"dataUpdated key object:_idMongoDB ObjectIdnameKey nameusage_limit_usdSpending cap, or nullcurrent_period_usage_usdSpending in current period (reset to $0 if reset_period changed)reset_periodReset period, or nullreset_atNext reset datetime, or nullexpire_atExpiration datetime, or nullcreated_atCreation datetime (ISO 8601)updated_atLast update datetime (ISO 8601)curl -X PATCH "https://api.ppq.ai/keys/KEY_ID" \
-H "Content-Type: application/json" \
-H "x-credit-id: YOUR_CREDIT_ID" \
-d '{
"name": "updated-key-name",
"usage_limit_usd": 25.00,
"reset_period": "weekly"
}'Revoke an API key. The key is soft-deleted and immediately stops working. This action cannot be undone.
status"success"message"API key revoked successfully"curl -X DELETE "https://api.ppq.ai/keys/KEY_ID" \
-H "x-credit-id: YOUR_CREDIT_ID"