- GET START
- OpenAI Compatiable Endpoint
- Audio
- Anthropic Compatiable Endpoint
- Music Generation Endpoint
- Image Generation Endpoint
- Video Generation Ednpoint
- 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
gpt-4o-image generates image
POST
https://api.cometapi.com/v1/chat/completions
Request
Header Params
Authorization
string
required
Example:
{{api-key}}
Body Params application/json
model
string
required
messages
array [object {2}]
required
role
string
optional
content
string
optional
stream
boolean
optional
temperature
integer
optional
top_p
integer
optional
n
integer
optional
stop
string
optional
max_tokens
integer
optional
presence_penalty
number
optional
frequency_penalty
number
optional
logit_bias
null
optional
user
string
optional
Examples
{
"model": "gpt-4o-image",
"messages": [
{
"role": "user",
"content": "Generate a cute kitten sitting on a cloud, cartoon style"
}
]
}
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
curl --location --request POST 'https://api.cometapi.com/v1/chat/completions' \
--header 'Authorization: {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o-image",
"messages": [
{
"role": "user",
"content": "Generate a cute kitten sitting on a cloud, cartoon style"
}
]
}'
Responses
🟢200Successful Response
text/plain
Body
id
string
required
object
string
required
created
integer
required
model
string
required
system_fingerprint
string
required
choices
array [object {3}]