Image Editing API
Documentation on our cost-friendly, state-of-the-art Image Editing API!
GoAPI now offers Remove backgroud
, Segment with prompt
, Super resolution(Upscale)
API for you to integrate into your app!
Pricing
This API is will be pay-as-you-go for all users, see details: Image Editing API | PPU Quota | Endpoint Usage.
Create API
This is a unified task creation endpoint for all Image Editing API, including
FaceSwap
, Remove backgroud
, Segment with prompt
and Super resolution(Upscale)
.Task Type List
Type | Description |
---|---|
background_remove | check Remove Background API |
segment | check Segment With Prompt API |
upscale | check Super Resolution API |
face_swap | TBD |
Request Example
curl --location 'https://api.goapi.ai/api/image_toolkit/v2/create' \
--header 'X-API-KEY: {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"task_type": "upscale",
"result_type": "url",
"task_input": {
"image": "https://example.com/cat.jpg",
"scale": 2
}
}'
Response Example
{
"code": 200,
"data": {
"task_id": "40307027-c713-4314-9c29-49e7f591733c", //important for retriving task result using Fetch API
"task_type": "upscale",
"status": "success",
"task_info": {
"created_at": "2024-03-19T09:38:59.975840Z",
"started_at": "2024-03-19T01:39:40.428051Z",
"completed_at": "2024-03-19T01:39:42.688459Z",
"frozen_credits": 0,
"task_input": {
"scale": 2,
"image": "https://example/cat.jpg"
}
},
"task_result": {
"used_credits": 0,
"error_messages": [],
"task_output": {
"image_base64": "",
"image_url": "https://img.midjourneyapi.xyz/temp/c8dd89d1-1d5f-47e1-8649-9.png"
}
}
},
"message": "success"
}
Fetch API
In most scenarios you will need a fetch call to retrive the task result, using
task_id
.Request Example
curl --location 'https://api.goapi.ai/api/image_toolkit/v2/fetch' \
--header 'X-API-KEY: {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"task_id": "82e0210d-0121-4eba-91d2-3c55333d79ee"
}'
Response Example
Same as Image Editing API Response
Status List
Status | description |
---|---|
pending | the task is in wait queue of GoAPI |
starting | the task is beginning to procceed |
processing | rendering the task |
success | task finished |
failed | task failed |
retry | this usually happens if your image url is hard to download |