Image Generation
curl --request POST \
--url https://aigenstudio.app/api/v1/image/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"input": {
"prompt": "Minimal ecommerce hero image of a glass skincare bottle on white marble."
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {
prompt: 'Minimal ecommerce hero image of a glass skincare bottle on white marble.'
}
})
};
fetch('https://aigenstudio.app/api/v1/image/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://aigenstudio.app/api/v1/image/generate"
payload = { "input": { "prompt": "Minimal ecommerce hero image of a glass skincare bottle on white marble." } }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api": "image_editing",
"status": "queued",
"sandbox": true,
"total_results": 123,
"credits_reserved": 123,
"created_at": "2023-11-07T05:31:56Z",
"completed_results": 123,
"failed_results": 123,
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
},
"remaining_paid_credits": 123,
"request_id": "<string>"
}{
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api": "image_editing",
"status": "queued",
"sandbox": true,
"total_results": 123,
"credits_reserved": 123,
"created_at": "2023-11-07T05:31:56Z",
"completed_results": 123,
"failed_results": 123,
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
},
"remaining_paid_credits": 123,
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}Create
Image Generation
Generate images from a prompt.
POST
https://aigenstudio.app/api/v1
/
image
/
generate
Image Generation
curl --request POST \
--url https://aigenstudio.app/api/v1/image/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"input": {
"prompt": "Minimal ecommerce hero image of a glass skincare bottle on white marble."
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {
prompt: 'Minimal ecommerce hero image of a glass skincare bottle on white marble.'
}
})
};
fetch('https://aigenstudio.app/api/v1/image/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://aigenstudio.app/api/v1/image/generate"
payload = { "input": { "prompt": "Minimal ecommerce hero image of a glass skincare bottle on white marble." } }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api": "image_editing",
"status": "queued",
"sandbox": true,
"total_results": 123,
"credits_reserved": 123,
"created_at": "2023-11-07T05:31:56Z",
"completed_results": 123,
"failed_results": 123,
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
},
"remaining_paid_credits": 123,
"request_id": "<string>"
}{
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api": "image_editing",
"status": "queued",
"sandbox": true,
"total_results": 123,
"credits_reserved": 123,
"created_at": "2023-11-07T05:31:56Z",
"completed_results": 123,
"failed_results": 123,
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
},
"remaining_paid_credits": 123,
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Stable key for safely retrying one logical create request.
Required string length:
8 - 160Pattern:
^[A-Za-z0-9._:-]+$Optional client correlation id. AI Gen Studio also returns request_id.
Maximum string length:
160Body
application/json
