API Documentation
Access multiple AI image processing APIs with a single API key and credits-based billing.
Quickstart
Get started in 3 simple steps:
- Create an account and get 100 free credits
- Generate an API key from your dashboard
- Make your first API call
Authentication
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer sk_your_api_keyBase URL
https://api.axionapi.com/v1Credits
Each API call costs a specific number of credits. Credits are deducted when a job is created.
| API | Credits |
|---|---|
| Image to Image | 5 |
| Text to Image | 3 |
| Background Remove | 2 |
| Image Upscale | 4 |
| Image Enhance | 3 |
| Watermark | 1 |
Run API
Submit an API job. Specify which API to use and provide the required input parameters.
/v1/runRequest 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.
/v1/jobs/:jobIdResponse (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 processedprocessingJob is currently being processedcompletedJob completed successfullyfailedJob failed - check error messageAPI Endpoints
Image to Image
5 creditsTransform images using AI with text prompts
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Description of desired transformation |
| image_url | string | URL of input image |
| strength | number | 0-1, how much to transform (default: 0.7) |
Text to Image
3 creditsGenerate images from text descriptions
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Description of image to generate |
| size | string | 512x512, 1024x1024, 1024x768, 768x1024 |
Background Remove
2 creditsRemove backgrounds from images automatically
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| image_url | string | URL of input image |
Image Upscale
4 creditsUpscale images up to 4x resolution
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| image_url | string | URL of input image |
| scale | number | 2 or 4 (default: 2) |
Image Enhance
3 creditsEnhance image quality and details
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| image_url | string | URL of input image |
Watermark
1 creditAdd a watermark image to any image with configurable position, opacity, and scale
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| image_url | string | URL of source image to watermark |
| watermark_image_url | string | URL of watermark image (PNG with transparency recommended) |
| watermark_position | string | bottom-right, bottom-left, top-right, top-left, center (default: bottom-right) |
| watermark_opacity | number | 0-100, watermark opacity percentage (default: 35) |
| watermark_scale | number | 0.05-0.5, watermark size as ratio of image width (default: 0.25) |
| watermark_margin | number | 0-0.1, margin from edge as ratio of image width (default: 0.03) |
Error Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request - invalid parameters |
| 401 | Unauthorized - invalid API key |
| 402 | Payment required - insufficient credits |
| 429 | Rate limit exceeded |
| 500 | Internal 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.