OhMyGPT API
English
  • 中文
  • English
  • 日本語
OhMyGPT
OhMyGPT
English
  • 中文
  • English
  • 日本語
  1. OpenAI
  • Introduction to this site
  • Change log
  • OpenAI
    • Responses
      • Create model response
      • Get model response
      • Delete model response
      • Cancel response
      • List input items
    • Conversations
      • create conversation
      • Retrieve conversation
      • update conversation
      • delete conversation
      • Create items
      • list items
      • Retrieve item
      • Delete item
    • create completion
      POST
    • TTS text to speech
      POST
    • Embeddings
      POST
    • image generation
      POST
    • image editing
      POST
  • Store
    • List chat completions
      POST
    • Get chat completed
      POST
    • Deletion of chat completed
      POST
  • Claude
    • Anthropic native Completions enterprise commercial API
      POST
    • Anthropic native Messages API
      POST
    • Anthropic native Messages Token Count API
      POST
  • OAuth开放API
    • Introduction to Open OAuth API
    • User authorization page
      GET
    • Code display page
      GET
    • Apply for access_token
      POST
    • Read basic user information
      POST
    • Read user balance information
      POST
    • Charge user fees
      POST
    • Create a Stripe Checkout recharge order for the user
      POST
    • Create a Stripe Invoice recharge order for the user
      POST
    • Call other open APIs
      POST
    • Read user management token through OAuth Token
      POST
    • Update user management token through OAuth Token
      POST
  • other
    • search
      • Google Custom Search API
      • Google Search By Serper
    • Azure
      • Azure text-to-speech
      • Azure gets TTS voice list
  • Override rules
    • Create rules
    • Update rules
    • delete rule
    • Get rules
    • list rules
    • Batch enable/disable
    • Copy rules
    • test rules
    • Get statistics
    • Get restriction configuration
    • Check rule name
    • Batch delete
    • Export rules
    • Import rules
  • image generation
    • other
      • ND image generation API
    • Flux
      • Flux Schnell image generation
      • Flux Dev image generation
      • Flux Pro image generation
      • Flux Pro 1.1 image generation
      • Flux 1.1 Pro Ultura image generation
  • Storage service
    • File storage service
    • File upload
    • File information update
    • Delete files
    • User query (pagination)
    • User metadata query (by fileUinqueIds)
    • File download interface (Public file download)
    • File download interface (Private private file download)
    • Obtain public file metadata
  • API KEY management
    • Create new API Key
    • Modify API Key information
    • Query all API Keys of the user
    • Delete the specified API Key
    • Interface for querying user membership expiration date
    • User balance query interface
    • Query the current model magnification interface
  • Archive documents
    • Self-service invoicing system usage documentation
    • Telegram Bot usage documentation
    • Self-built Cloudflare Worker anti-generation tutorial
    • Claude Code forwarding service
    • CodeX forwarding service
    • Introduction to the new website
  • Model list
    GET
  1. OpenAI

image generation

line1
https://cn2us02.opapi.win
line1
https://cn2us02.opapi.win
POST
/v1/images/generations
You can use OpenAI's latest image generation AI in this interface:
gpt-image-1
dall-e-3
and older versions of dall-e-2
Note:
Now the Image related API supports Callback, just pass this parameter:
ohmygpt_webhook_url: API interface accessible from the public network. When an Image-related request succeeds or fails, a Post request will be sent to this URL.
The callback data format is as follows:
{
    success: true,
    status: 'succeed',
    message: null,
    code: 200,
    data: resdata,
}
Among the key data:
success: whether it was successful or not
data: response data
The effect is as follows:
image.png

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Body 参数application/x-www-form-urlencoded

返回响应

🟢200success
application/json
Body

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://cn2us02.opapi.win/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--data-urlencode 'prompt=A cute anime girl' \
--data-urlencode 'background=auto' \
--data-urlencode 'model=dall-e-3' \
--data-urlencode 'moderation=auto' \
--data-urlencode 'n=1' \
--data-urlencode 'output_compression=100' \
--data-urlencode 'output_format=png' \
--data-urlencode 'partial_images=0' \
--data-urlencode 'quality=auto' \
--data-urlencode 'response_format=url' \
--data-urlencode 'size=1024x1024' \
--data-urlencode 'stream=false' \
--data-urlencode 'style=vivid' \
--data-urlencode 'user='
响应示例响应示例
Successful example(DALL·E3)
{
    "created": 1699413579,
    "data": [
        {
            "revised_prompt": "Create an anime-style image of a young female character with serene white hair. She has a classic charm reminiscent of popular manga characters. Her features, while unique and striking, evoke a sense of familiarity and comfort, likely due to their adherence to popular anime aesthetics. Her hair, bright and white, cascades down in loose curls, reflecting her youth and vitality. Her eyes, wide and expressive, are shimmering with life, embodying the vibrant spirit of anime heroines.",
            "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-kfoU3d52DhdDtaZCzTmS5I7C/user-UedaU9TyNiOob86Re2x21o2m/img-FnzJbqc2K2538Kpt4K8zGLkG.png?st=2023-11-08T02%3A19%3A39Z&se=2023-11-08T04%3A19%3A39Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-08T01%3A22%3A52Z&ske=2023-11-09T01%3A22%3A52Z&sks=b&skv=2021-08-06&sig=q2y01gp7dG7apuLGCdgvsX7e///m6pbeJwOIuWJEmMU%3D"
        }
    ]
}
修改于 2025-10-16 06:49:19
上一页
Embeddings
下一页
image editing
Built with