API Documentation

Access multiple AI image processing APIs with a single API key and credits-based billing.

Quickstart

Get started in 3 simple steps:

  1. Create an account and get 100 free credits
  2. Generate an API key from your dashboard
  3. Make your first API call

Authentication

All API requests require authentication using your API key in the Authorization header:

Authorization: Bearer sk_your_api_key

Base URL

https://api.axionapi.com/v1

Credits

Each API call costs a specific number of credits. Credits are deducted when a job is created.

APICredits
Image to Image5
Text to Image3
Background Remove2
Image Upscale4
Image Enhance3
Watermark1

Run API

Submit an API job. Specify which API to use and provide the required input parameters.

POST/v1/run

Request Body

{
  "api": "image-to-image",
  "input": {
    "prompt": "turn this into a watercolor painting",
    "image_url": "https://example.com/input.png",
    "strength": 0.7
  }
}
curl https://api.axionapi.com/v1/run \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "api": "image-to-image",
    "input": {
      "prompt": "turn this into a watercolor painting",
      "image_url": "https://example.com/input.png"
    }
  }'

Response

{
  "jobId": "job_abc123xyz",
  "status": "queued",
  "creditsCharged": 5
}

Job Status

Poll this endpoint to check the status of your job.

GET/v1/jobs/:jobId

Response (Completed)

{
  "jobId": "job_abc123xyz",
  "status": "completed",
  "outputUrl": "https://cdn.axionapi.com/outputs/abc123.png",
  "creditsCharged": 5,
  "processingTimeMs": 4523
}

Job Statuses

queuedJob is waiting to be processed
processingJob is currently being processed
completedJob completed successfully
failedJob failed - check error message

API Endpoints

Image to Image

5 credits

Transform images using AI with text prompts

Input Parameters

ParameterTypeDescription
promptstringDescription of desired transformation
image_urlstringURL of input image
strengthnumber0-1, how much to transform (default: 0.7)

Text to Image

3 credits

Generate images from text descriptions

Input Parameters

ParameterTypeDescription
promptstringDescription of image to generate
sizestring512x512, 1024x1024, 1024x768, 768x1024

Background Remove

2 credits

Remove backgrounds from images automatically

Input Parameters

ParameterTypeDescription
image_urlstringURL of input image

Image Upscale

4 credits

Upscale images up to 4x resolution

Input Parameters

ParameterTypeDescription
image_urlstringURL of input image
scalenumber2 or 4 (default: 2)

Image Enhance

3 credits

Enhance image quality and details

Input Parameters

ParameterTypeDescription
image_urlstringURL of input image

Watermark

1 credit

Add a watermark image to any image with configurable position, opacity, and scale

Input Parameters

ParameterTypeDescription
image_urlstringURL of source image to watermark
watermark_image_urlstringURL of watermark image (PNG with transparency recommended)
watermark_positionstringbottom-right, bottom-left, top-right, top-left, center (default: bottom-right)
watermark_opacitynumber0-100, watermark opacity percentage (default: 35)
watermark_scalenumber0.05-0.5, watermark size as ratio of image width (default: 0.25)
watermark_marginnumber0-0.1, margin from edge as ratio of image width (default: 0.03)

Error Codes

CodeDescription
200Success
400Bad request - invalid parameters
401Unauthorized - invalid API key
402Payment required - insufficient credits
429Rate limit exceeded
500Internal server error

Rate Limits

API requests are subject to the following limits:

  • Free tier: 10 requests per minute
  • Paid users: 60 requests per minute
  • Contact us for higher limits

Need help?

If you have questions or need assistance, we're here to help.