Skip to Content
aicentos
API ReferenceImages APIOpenAI

Generate Image

Last updated:

Images — native OpenAI format

POST /images/generations

Authentication

Store your API key in AICENTOS_API_KEY; the shell examples expand it in the Authorization: Bearer header.

The API Key obtained under "Token Management" in the console

Location: header

Request Body

application/json

TypeScript type definition

Use the request body type in TypeScript

Response Body

application/json

export AICENTOS_API_KEY="sk-your-aicentos-api-key"

curl -X POST "https://aicentos.com/v1/images/generations" \
  -H "Authorization: Bearer $AICENTOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{    "model": "gpt-image-2",    "prompt": "A futuristic city skyline at sunset, neon lights, cinematic",    "size": "1024x1024",    "quality": "hd"  }'
{
  "created": 0,
  "background": "string",
  "output_format": "string",
  "quality": "string",
  "size": "string",
  "data": [
    {
      "url": "string",
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ],
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0,
    "input_tokens_details": {
      "text_tokens": 0,
      "image_tokens": 0
    },
    "output_tokens_details": {
      "text_tokens": 0,
      "image_tokens": 0
    }
  }
}