curl --request POST \
--url https://api.geekidea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a cat wearing a spacesuit",
"model": "openai/gpt-image-2",
"n": 1,
"quality": "medium",
"size": "1024x1024",
"response_format": "url",
"background": "<string>",
"moderation": "<string>",
"output_compression": 50,
"output_format": "<string>",
"partial_images": 123,
"stream": true,
"style": "<string>",
"user": "<string>",
"generation_config": {
"resolution": "2K",
"aspect_ratio": "16:9",
"seed": 123,
"negative_prompt": "<string>"
},
"metadata": {}
}
'import requests
url = "https://api.geekidea.ai/v1/images/generations"
payload = {
"prompt": "a cat wearing a spacesuit",
"model": "openai/gpt-image-2",
"n": 1,
"quality": "medium",
"size": "1024x1024",
"response_format": "url",
"background": "<string>",
"moderation": "<string>",
"output_compression": 50,
"output_format": "<string>",
"partial_images": 123,
"stream": True,
"style": "<string>",
"user": "<string>",
"generation_config": {
"resolution": "2K",
"aspect_ratio": "16:9",
"seed": 123,
"negative_prompt": "<string>"
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'a cat wearing a spacesuit',
model: 'openai/gpt-image-2',
n: 1,
quality: 'medium',
size: '1024x1024',
response_format: 'url',
background: '<string>',
moderation: '<string>',
output_compression: 50,
output_format: '<string>',
partial_images: 123,
stream: true,
style: '<string>',
user: '<string>',
generation_config: {resolution: '2K', aspect_ratio: '16:9', seed: 123, negative_prompt: '<string>'},
metadata: {}
})
};
fetch('https://api.geekidea.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}Create images
Compatible with OpenAI Images. Originals are kept in private storage and returned as signed links plus four thumbnails; usage includes the cost (USD) and id is the billing ID.
curl --request POST \
--url https://api.geekidea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a cat wearing a spacesuit",
"model": "openai/gpt-image-2",
"n": 1,
"quality": "medium",
"size": "1024x1024",
"response_format": "url",
"background": "<string>",
"moderation": "<string>",
"output_compression": 50,
"output_format": "<string>",
"partial_images": 123,
"stream": true,
"style": "<string>",
"user": "<string>",
"generation_config": {
"resolution": "2K",
"aspect_ratio": "16:9",
"seed": 123,
"negative_prompt": "<string>"
},
"metadata": {}
}
'import requests
url = "https://api.geekidea.ai/v1/images/generations"
payload = {
"prompt": "a cat wearing a spacesuit",
"model": "openai/gpt-image-2",
"n": 1,
"quality": "medium",
"size": "1024x1024",
"response_format": "url",
"background": "<string>",
"moderation": "<string>",
"output_compression": 50,
"output_format": "<string>",
"partial_images": 123,
"stream": True,
"style": "<string>",
"user": "<string>",
"generation_config": {
"resolution": "2K",
"aspect_ratio": "16:9",
"seed": 123,
"negative_prompt": "<string>"
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'a cat wearing a spacesuit',
model: 'openai/gpt-image-2',
n: 1,
quality: 'medium',
size: '1024x1024',
response_format: 'url',
background: '<string>',
moderation: '<string>',
output_compression: 50,
output_format: '<string>',
partial_images: 123,
stream: true,
style: '<string>',
user: '<string>',
generation_config: {resolution: '2K', aspect_ratio: '16:9', seed: 123, negative_prompt: '<string>'},
metadata: {}
})
};
fetch('https://api.geekidea.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "not_found_error",
"param": "model",
"code": "model_not_found",
"retryable": false,
"errors": [
{
"param": "messages",
"code": "missing_parameter",
"message": "<string>"
}
]
}
}Authorizations
Provide your API key in the Authorization header using Bearer auth
Headers
Set to respond-async to process asynchronously: returns 202 with a Generation object right away; poll GET /v1/generations/{id} for the result
Idempotency key for asynchronous requests (up to 255 characters): the same key in the same project is accepted only once, and a repeat returns the existing generation
Body
Image generation request
Prompt
32000"a cat wearing a spacesuit"
Model ID (author/model). See GET /v1/models?type=image
1"openai/gpt-image-2"
Number of images, 1-10
1 <= x <= 101
Quality: low / medium / high / auto …; affects price
"medium"
Size, e.g. 1024x1024, 1536x1024 or auto
"1024x1024"
Response format: url (default, signed link) / b64_json
"url"
Background: transparent / opaque / auto
Moderation level: low / auto
Output compression 0-100 (jpeg / webp)
0 <= x <= 100Output format: png / jpeg / webp
Partial images when streaming (streaming not supported yet)
Whether to stream (not supported yet)
Style: vivid / natural
End-user identifier for abuse detection
Image generation parameters
Show child attributes
Show child attributes
Caller-defined data (up to 16 keys), shown in billing
Show child attributes
Show child attributes
Response
OK
The response is of type object.
