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-sonnet-4.6",
"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 YOUR_API_KEY" \
-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?"}]
}'Private models run inside Trusted Execution Environments — hardware-attested secure enclaves on NVIDIA confidential-computing GPUs, powered by Tinfoil. Your request body is encrypted in your process with HPKE before it leaves your machine, decrypted only inside the attested enclave, and re-encrypted on the way back. PPQ can only see ciphertext and routing metadata — never your prompts or completions.
Important: You cannot call https://api.ppq.ai/v1/chat/completions with a private/* model directly. The request body must be HPKE-encrypted against the enclave's attested public key, which requires running our open-source local proxy: PayPerQ/ppq-private-mode-proxy. See the repo for setup, configuration, and code examples.
Weights are identical to the standard counterparts — the only difference is the enclave + end-to-end encryption. Fetch the current list with GET /v1/models?type=all and filter for IDs beginning with private/.
private/kimi-k2-5Kimi K2.5 — native multimodal, strong coding. Recommended for agentic / OpenClaw workflows.private/deepseek-r1-0528DeepSeek R1 — reasoning and analysis (671B, 37B active)private/gpt-oss-120bGPT-OSS 120B — reasoning, function calling, budget-friendly general useprivate/llama3-3-70bLlama 3.3 70B — fast, multilingualprivate/qwen3-vl-30bQwen3-VL 30B — vision-language, multilingual OCRprivate/glm-5-1, private/gemma4-31bAdditional TEE modelsConvert audio to text using our OpenAI-compatible transcription API. Powered by Deepgram Nova-3 for high-quality, accurate transcriptions.
POST https://api.ppq.ai/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 styleGET /v1/audio/models to fetch the current list of STT models with pricing.curl https://api.ppq.ai/v1/audio/modelsfrom openai import OpenAI
# Initialize client with PayPerQ API
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.ppq.ai/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 and ElevenLabs for high-quality voice synthesis.
POST https://api.ppq.ai/v1/audio/speechinput*The text to convert to speech (max 2000 chars for DeepGram / 5000 chars for ElevenLabs)modelModel to use: DeepGram voice (e.g. "aura-2-arcas-en") or ElevenLabs model (e.g. "eleven_turbo_v2_5"). Default: "aura-2-arcas-en"voiceVoice ID override. For DeepGram: Aura voice (e.g. "aura-2-arcas-en"). For ElevenLabs: voice ID (e.g. "JBFqnCBsd6RMkjVDRZzb"). Defaults to provider's default voice.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, CaringGET /v1/audio/voices to fetch the full list of available voices across all providers (DeepGram + ElevenLabs).curl https://api.ppq.ai/v1/audio/voicesfrom openai import OpenAI
# Initialize client with PayPerQ API
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.ppq.ai/v1"
)
# Generate speech from text
response = client.audio.speech.create(
model="deepgram_aura_2",
voice="aura-2-arcas-en",
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/generationsParameter support varies by model. The image models reference lists which parameters each model accepts (required vs. optional).
model*The model to use for generation (see Available Models below).promptA text description of the desired output. Required for generation models; not used by upscalers and background-removal models.image_urlSource image URL. Required for upscalers, background removal, and explicit image-to-image models; optional on many generation models to enable editing/variation.nNumber of images to generate, 1–4 (default: 1). Also accepted as num_images.qualityQuality tier. Allowed values differ per model — each model's badge lists its options (e.g. quality: low|medium|high).sizeAspect ratio (e.g. "1:1", "16:9", "9:16"). Also accepted as aspect_ratio.resolutionOutput resolution for models that support it. Each model's badge lists its options (e.g. resolution: 1K|2K|4K).negative_promptText describing what to avoid in the generated image.output_formatOutput file format: "png", "jpeg", or "webp".Compatibility note: Clients like OpenWebUI, LibreChat, and the OpenAI SDKs follow the OpenAI Images API spec and expect a separate /v1/images/edits endpoint, so PPQ also exposes POST https://api.ppq.ai/v1/images/edits. It accepts multipart/form-data with an image file, prompt, and model, and returns the same response shape as this endpoint. Pricing is identical. If you're coding directly against PPQ, stay on the regular /v1/images/generations.
The example below uses nano-banana-2. Browse all image models with capabilities and code examples →
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": "nano-banana-2",
"prompt": "A futuristic cityscape at sunset",
"resolution": "1K",
"n": 1
}
response = requests.post(url, json=data, headers=headers)
result = response.json()
for image in result["data"]:
print(image["url"]) # signed URL served by PPQ (valid 24h){
"created": 1709234567,
"model": "nano-banana-2",
"cost": 0.0805,
"data": [
{
"url": "https://api.ppq.ai/v1/media/gen_abc123/0?sig=...&exp=...",
"content_type": "image/png"
}
]
}url is a signed URL served by PPQ (valid 24h). Download the bytes before it expires if you need long-term storage.
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) — 8skling-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_urlkling-2.1-master-i2vKling 2.1 Master I2V — 5s, 10skling-2.5-turbo-i2vKling 2.5 Turbo I2V — 5s, 10sGET /v1/models?type=image,video 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}Access 27 data enrichment endpoints covering people search, company lookup, web scraping, Google Maps, Reddit, email verification, and social media enrichment. Authenticate with a PPQ API key (deducts from your credit balance) or pay per-request via 402 payment protocols — see the 402 Payments section below.
Base URL: https://api.ppq.ai/v1/data
Browse full endpoint reference with descriptions and parameters →
List all available enrichment endpoints with pricing. No authentication required.
curl https://api.ppq.ai/v1/data/endpointsSee the pricing page for per-request costs.
| Provider | Endpoint | Method |
|---|---|---|
| Google Maps | /api/google-maps/text-search/full | POST |
| Google Maps | /api/google-maps/text-search/partial | POST |
| Google Maps | /api/google-maps/nearby-search/full | POST |
| Google Maps | /api/google-maps/nearby-search/partial | POST |
| Google Maps | /api/google-maps/place-details/full | GET |
| Google Maps | /api/google-maps/place-details/partial | GET |
| Apollo | /api/apollo/people-search | POST |
| Apollo | /api/apollo/org-search | POST |
| Apollo | /api/apollo/people-enrich | POST |
| Apollo | /api/apollo/org-enrich | POST |
| Exa | /api/exa/search | POST |
| Exa | /api/exa/find-similar | POST |
| Exa | /api/exa/contents | POST |
| Exa | /api/exa/answer | POST |
| Firecrawl | /api/firecrawl/scrape | POST |
| Firecrawl | /api/firecrawl/search | POST |
| Clado | /api/clado/contacts-enrich | POST |
| Clado | /api/clado/linkedin-scrape | POST |
| Serper | /api/serper/news | POST |
| Serper | /api/serper/shopping | POST |
/api/reddit/search | POST | |
/api/reddit/post-comments | POST | |
| Whitepages | /api/whitepages/person-search | POST |
| Whitepages | /api/whitepages/property-search | POST |
| Hunter | /api/hunter/email-verifier | POST |
| Influencer | /api/influencer/enrich-by-email | POST |
| Influencer | /api/influencer/enrich-by-social | POST |
Pass your API key via Authorization: Bearer sk-... header. Cost is deducted from your PPQ credit balance. Alternatively, you can pay per-request using 402 payment protocols — no account required.
Search for people matching your criteria using an API key.
curl -X POST https://api.ppq.ai/v1/data/api/apollo/people-search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"q_keywords": "software engineer",
"person_locations": ["San Francisco"],
"per_page": 5
}'Generate vector embeddings for text input using models from OpenAI, Qwen, NVIDIA, and more. Embeddings are useful for semantic search, clustering, classification, and RAG (Retrieval-Augmented Generation) pipelines.
Endpoint: POST https://api.ppq.ai/v1/embeddings
OpenAI SDK compatible — use client.embeddings.create() with your PPQ API key.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Embedding model ID (e.g. openai/text-embedding-3-small) |
input | string | string[] | Yes | Text to embed. Can be a single string or an array of strings for batch embedding. |
encoding_format | string | No | Output format: float (default) or base64 |
dimensions | number | No | Desired output dimensions (supported by some models like text-embedding-3-small/large) |
Fetch the current list of embedding models dynamically:
curl https://api.ppq.ai/v1/models?type=embeddingPopular embedding models include:
| Model | Provider | Max Tokens |
|---|---|---|
openai/text-embedding-3-small | OpenAI | 8,191 |
openai/text-embedding-3-large | OpenAI | 8,191 |
Generate embeddings for text input.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.ppq.ai/v1"
)
response = client.embeddings.create(
model="openai/text-embedding-3-small",
input="The quick brown fox jumps over the lazy dog"
)
print(response.data[0].embedding[:5]) # First 5 dimensions
print(f"Total tokens: {response.usage.total_tokens}")Pass an array of strings to embed multiple texts in a single request:
curl -X POST https://api.ppq.ai/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "openai/text-embedding-3-small",
"input": [
"First document to embed",
"Second document to embed",
"Third document to embed"
]
}'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 YOUR_API_KEY" \
-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 YOUR_API_KEY"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: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 0.001, "currency": "BTC"}'curl -X POST https://api.ppq.ai/topup/create/xmr \
-H "Authorization: Bearer YOUR_API_KEY" \
-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"Retrieve your account's query history. Authenticate via Authorization: Bearer <api_key>, api-key header, or credit_id query param. When authenticated via API key, results are scoped to that key by default; pass all_keys=true to see all queries on the account.
credit_idAuthenticate as a full account (alternative to API key auth)all_keysWhen true, include queries from all API keys (only valid when authed via API key)api_keyFilter by a specific API key string (only valid when authed via credit_id)start_dateISO 8601 date — return queries on or after this dateend_dateISO 8601 date — return queries on or before this datemodelFilter by model namequery_sourceFilter by query sourcequery_typeFilter by query typepagePage number (default: 1)page_countResults per page, max 100 (default: 20)status"success"dataArray of query records, each with:timestampWhen the query was made (ISO 8601)modelModel usedinput_countInput token countoutput_countOutput token countprice_in_usdCost of the query in USDquery_typeType of queryquery_sourceSource of the queryapi_key_idID of the API key usedisOnlineWhether the query used online/search modeisFreeModelWhether the model was freepaginationObject with page, page_count, total, total_pagescurl -X GET "https://api.ppq.ai/queries/history?page=1&page_count=20" \
-H "Authorization: Bearer YOUR_API_KEY"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"Pay for individual API requests using the HTTP 402 payment protocol — no account or API key required. Currently supported via L402 (Bitcoin Lightning).
Authorization header.402 Payment Required with a WWW-Authenticate: Payment header containing a challenge and a Lightning invoice.Authorization header. The server verifies the payment and returns the data.402-compatible clients such as lnget and mppx automate this challenge-pay-replay loop.
| Category | Endpoint | Method | Pricing |
|---|---|---|---|
| Data Enrichment | /v1/data/api/*, /v1/data/x/* | GET / POST | Fixed per-endpoint (see Data Enrichment) |
| Image Generation | /v1/images/generations | POST | Dynamic — varies by model, size, and quality (see Image Generation) |
| Image Editing (OpenAI-spec) | /v1/images/edits | POST | Same pricing as Image Generation — compatibility endpoint for OpenAI-spec clients |
| Video Generation | /v1/videos | POST | Dynamic — varies by model, duration, and resolution (see Video Generation) |
# 1. Request without auth — get a 402 challenge with a Lightning invoice
curl -i -X POST https://api.ppq.ai/v1/data/api/apollo/people-search \
-H "Content-Type: application/json" \
-d '{"q_keywords": "software engineer", "per_page": 5}'
# Response: 402 Payment Required
# WWW-Authenticate: Payment id="...", method="lightning", ...
# 2. Pay the invoice, then replay with the payment credential
curl -X POST https://api.ppq.ai/v1/data/api/apollo/people-search \
-H "Content-Type: application/json" \
-H "Authorization: L402 <token>:<preimage>" \
-d '{"q_keywords": "software engineer", "per_page": 5}'# lnget handles the 402 challenge and Lightning payment automatically
lnget -X POST \
-d '{"model": "gpt-image-1", "prompt": "a sunset over mountains", "size": "1024x1024"}' \
--content-type application/json \
--max-cost 500 \
https://api.ppq.ai/v1/images/generations# Submit a video generation job — returns 202 with a signed status URL
lnget -X POST \
-d '{"model": "kling-2.1-standard", "prompt": "ocean waves at sunset", "duration": "5", "aspect_ratio": "16:9", "quality": "720p"}' \
--content-type application/json \
--max-cost 500 \
https://api.ppq.ai/v1/videos
# Poll the status URL from the response (no auth needed — URL is signed)
lnget "<status_url>"
# Video generation returns:
# { "id": "gen_...", "status": "pending", "status_url": "https://..." }status_url — a signed URL you can poll without authentication to check progress and retrieve the final video.Authorization: Bearer sk-... — the 402 flow is only triggered when no API key is provided.