API Doc-CometAPI
HomeDashBoardModel_Price
HomeDashBoardModel_Price
Discord_Support
  1. OpenAI Compatiable Endpoint
  • GET START
    • Model New Release Announcement
    • Help Center
    • Quick Start
    • About Pricing
    • About Grouping
    • Interface Stability
    • Privacy policy
    • Terms of service
    • Error code description
    • Code example
    • Must see for use
    • Common Misconceptions
    • Confusion about use
    • Best Practices
      • CometAPI Account Balance Query API Usage Instructions
      • Retry Logic Documentation for CometAPI and OpenAI Official API
      • Midjourney Best Practices
      • Runway Best Practices
  • OpenAI Compatiable Endpoint
    • gpt-4o-image generates image
      POST
    • Chat
      POST
    • Recognizing Images
      POST
    • Models
      GET
    • Embeddings
      POST
    • Images
      POST
    • Realtime
      POST
    • Image Editing (gpt-image-1)
      POST
  • Audio
    • Create speech
    • Create transcription
    • Create translation
  • Anthropic Compatiable Endpoint
    • Anthropic Claude
  • Music Generation Endpoint
    • Suno
      • Setting suno Version
      • Generate lyrics
      • Generate music clip
      • Upload clip
      • Submit concatenation
      • Single task query
      • Batch query tasks
    • Udio(Temporarily unavailable)
      • Generate music
      • Task query
  • Image Generation Endpoint
    • Midjourney(images)
      • Task Fetching API
        • List by Condition
        • Fetch Single Task (most recommended)
      • Imagine
      • Change (UPSCALE; VARIATION; REROLL)
      • Action (UPSCALE; VARIATION; REROLL; ZOOM, etc.)
      • Blend (image -> image)
      • Describe (image -> text)
      • Modal (Area Redesign & Zoom)
    • Ideogram(images)
      • Official documentation (updated in real time)
      • Generate 3.0 (text to image)
      • Remix 3.0 (hybrid image)
      • Reframe 3.0(Reconstruction)
      • Replace Background 3.0(Background replacement)
      • Edit 3.0(Editing images)
      • ideogram Text Raw Image
      • ideogram Hybrid image
      • ideogram enlargement HD
      • ideogram describes the image
      • ideogram Edit image
    • Flux(images)
      • Generate image (replicate format)
      • flux fine-tune images(Temporarily unavailable)
      • flux generate image(Temporarily unavailable)
      • flux query
    • Replicate(image)
      • replicate Generate
      • replicate query
    • Recraft(images)
      • Appendix
      • Recraft Generate Image
      • Recraft Vectorize Image
      • Recraft Remove Background
      • Recraft Clarity Upscale
      • Recraft Create style
      • Recraft Generative Upscale
  • Video Generation Ednpoint
    • runway(video)
      • official format
        • runway images raw video
        • runway to get task details
      • Reverse Format
        • generate(text)
        • generate(Reference images)
        • Video to Video Style Redraw
        • Act-one Expression Migration
        • feed-get task
    • kling (video)
      • callback_url
      • Generating images
      • Text Generation Video
      • Image Generation Video
      • Video Extension
      • virtual try-on
      • lip sync
      • Individual queries (videos)
    • MiniMax Conch(video)
      • MiniMax Conch Official Documentation
      • MiniMax Conch Generation
      • MiniMax Conch Query
      • MiniMax Conch Download
    • luma (video)
      • Official api interface format
        • luma generate
        • luma search
    • PIKA(video)
      • pika feed
      • PIKA Reference Video Generation
      • PIKA Reference Image Generation
      • PIKA reference text generation
    • sora
      • Reverse Format
        • Create Video
        • Query Video Task
        • Create Video
  • Software Integration Guide
    • cometapi Site API Call Testing
    • OpenManus
    • Chatbox
    • CherryStudio
    • Cursor
    • ChatHub
    • cline
    • dify
    • gptme
    • Immersive Translation
    • Lobe-Chat
    • Zotero
    • LangChain
    • AnythingLLM
    • Eudic Translation
    • OpenAI Translator
    • ChatAll Translation
    • Pot Translation
    • GPT Academic Optimization (gpt_academic)
    • NEXT CHAT (ChatGPT Next Web)
    • Obsidian's Text Generator Plugin
    • Open WebUI
    • avante.nvim
    • librechat
    • Lazy Customer Service
    • utools-ChatGPT Friend
    • IntelliJ Translation Plugin
    • n8n
  1. OpenAI Compatiable Endpoint

Images

POST
https://api.cometapi.com/v1/images/generations
Maintainer:Not configured

Generate Images#

This API endpoint allows you to generate images based on the provided model, prompt, and other parameters.

Request Body#

model (string, required): The model to be used for image generation.
prompt (string, required): The prompt for image generation.
n (integer, required): The number of images to generate.
size (string, required): The size of the generated image.

Request

Header Params
Authorization
string 
required
Example:
Bearer {{api-key}}
Body Params application/json
model
string 
required
Default: dall-e-3
Default:
dall-e-3
Example:
gpt-image-1
prompt
string 
required
Text description of the desired image. The maximum length is 1000 characters.
n
integer 
optional
Number of images to generate. Must be between 1 and 10.
size
string 
optional
The size of the generated image. Must be one of 256x256, 512x512, or 1024x1024.
Example
{
  "model": "dall-e-3",
  "prompt": "A cute baby sea otter",
  "n": 1,
  "size": "1024x1024"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.cometapi.com/v1/images/generations' \
--header 'Authorization: Bearer {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "dall-e-3",
    "prompt": "A cute baby sea otter",
    "n": 1,
    "size": "1024x1024"
}'

Responses

🟢200Successful Response
application/json
Body
created
integer 
required
Unix timestamp of when the image generation task was completed
data
array [object {2}] 
required
A list containing information about the generated images.
revised_prompt
string 
optional
The model may have optimized or rewritten the original prompt words provided by the user.
url
string 
optional
A URL pointing to the generated image file. this URL is usually time-sensitive and the user needs to download the image in time.
Example
{
  "created": 1737352021,
  "data": [
    {
      "revised_prompt": "A small and adorable sea otter pup. It's floating on its back in a tranquil, azure sea, sunlight streaming down on its thick, wet fur. The otter pup is contentedly munching on a bright pink shrimp, holding it between its little paws while remaining completely buoyant, displaying its nimble acrobatic skills that come naturally to its species. The pup's eyes are bright with curiosity and innocence, exploring the vast sea around it while enjoying its meal. The blue-green water around it is dancing with the sunlight, creating a serene environment for the otter pup's mealtime.",
      "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-nRhUPivdBTlVXzF8KaZBo9vY/user-IuAvdMlDArmYuupuySzt6BqQ/img-AtYEsUJaP70OFEPyqFbSuxSE.png?st=2025-01-20T04%3A47%3A01Z&se=2025-01-20T06%3A47%3A01Z&sp=r&sv=2024-08-04&sr=b&rscd=inline&rsct=image/png&skoid=d505667d-d6c1-4a0a-bac7-5c84a87759f8&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2025-01-20T00%3A45%3A01Z&ske=2025-01-21T00%3A45%3A01Z&sks=b&skv=2024-08-04&sig=Op4s4mFKwrX6i/O43KZ/23EAWY2LnQTfY2ooxaFZNM0%3D"
    }
  ]
}
Previous
Embeddings
Next
Realtime
Built with