Docs
Build with Artany APIs
Choose the product documentation that matches your integration. Generation uses durable asynchronous jobs; alpha, beta, and gamma moderation return final decisions synchronously.
Authentication
Create an API key in the console and send it as a Bearer token. Keys are scoped to one workspace (personal or team) and are shown only once at creation. Generation requests should also carry a unique Idempotency-Key (8–128 characters) — retrying with the same key never double-charges.
Authorization: Bearer arta_live_... Idempotency-Key: request-20260718-001
Quickstart
Submit a job, then poll it until it reaches a terminal status. Every model on the catalog accepts the same envelope — model + prompt plus model-specific options documented on each model page and in GET /v1/models/{model}.
1 · Create a job
curl -X POST "https://api.artany.ai/v1/images/generations" \
-H "Authorization: Bearer $ARTANY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-$(date +%s)" \
-d '{"model": "artany-z-image-turbo", "prompt": "a lighthouse at dawn, watercolor"}'2 · Poll until it finishes
curl "https://api.artany.ai/v1/jobs/{jobId}" \
-H "Authorization: Bearer $ARTANY_API_KEY"
# => {
# "id": "...",
# "object": "generation.job",
# "model": "artany-z-image-turbo",
# "status": "succeeded",
# "output": { "urls": ["https://cdn.artany.ai/results/..."] },
# "billing": { "estimated_credits": "18", "charged_credits": "18", "state": "settled" }
# }Poll every 2–3 seconds while a job is queued or running. Output URLs are served from our CDN and remain stable. Ready-to-paste cURL, Python, and Node samples ship on every model page.
Python example
import os, time, requests
base = "https://api.artany.ai"
headers = {
"Authorization": f"Bearer {os.environ['ARTANY_API_KEY']}",
"Content-Type": "application/json",
"Idempotency-Key": "my-unique-request-id",
}
job = requests.post(
f"{base}/v1/images/generations",
headers=headers,
json={"model": "artany-z-image-turbo", "prompt": "a lighthouse at dawn"},
).json()
while job["status"] in ("queued", "running"):
time.sleep(2)
job = requests.get(f"{base}/v1/jobs/{job['id']}", headers=headers).json()
print(job["status"], job.get("output"))Job lifecycle
queued → running → succeeded | failed | canceled
- On submit, the maximum charge for the request is quoted and frozen from your balance.
- The job runs asynchronously; poll
GET /v1/jobs/{jobId}for status. - On success, the fixed catalog price is settled and any unused frozen amount is refunded.
- On failure or cancellation, the full frozen amount is refunded automatically.
Endpoints
Base URL: https://api.artany.ai/v1
/v1/modelsList public models available to the API key./v1/models/{model}Read the public schema, defaults, and a sample request for one model./v1/credits/estimateQuote estimated and maximum Credits before generation./v1/credits/balanceRead the workspace Credits balance and frozen amount./v1/credits/transactionsRead the workspace credit ledger./v1/images/generationsCreate a text-to-image job./v1/images/editsCreate an image-editing job./v1/videos/generationsCreate text, image, or reference video jobs./v1/videos/editsCreate a video-editing job./v1/moderations/models/alphaSynchronously moderate text, images, or video with alpha./v1/moderations/models/betaSynchronously moderate sexual content with beta./v1/moderations/models/gammaSynchronously check explicit sexual content in text with gamma./v1/jobs/{jobId}Read job status, output, and final Credit settlement.Credits & billing
1 Credit = $0.01. Every model lists a fixed Credit price per configuration (resolution, duration, output count…) on the pricing page — the listed price is exactly what a successful run settles for. Use POST /v1/credits/estimate to quote a request before submitting, and GET /v1/credits/transactions to reconcile the ledger. Credits never expire and there is no subscription.
For request schema, responses, and policy integration guidance, see the Moderation Docs.
Errors
Errors return an error object with code, message, request_id, and an optional param. Include the request id when contacting support.
| Code | HTTP | Meaning |
|---|---|---|
| AUTHENTICATION_REQUIRED | 401 | Missing or invalid API key. |
| KEY_SCOPE_FORBIDDEN | 403 | The key is not allowed to perform this action. |
| MODEL_NOT_FOUND | 404 | The model id is not in the public catalog. |
| INVALID_REQUEST | 400 | A parameter is missing or outside the model schema. |
| INSUFFICIENT_CREDITS | 402 | Balance is below the maximum charge for this job. |
| RATE_LIMITED | 429 | Too many requests — retry with backoff. |
| INTERNAL | 500 | Unexpected server error; safe to retry with the same Idempotency-Key. |