1. OpenAI
TikHub-AI-Proxy
  • Overview (PLEASE READ)
  • Streaming API
  • OpenAI
    • OpenAI response
      POST
    • OpenAI embeddings
      POST
    • OpenAI audio transcription
      POST
    • OpenAI chat completion
      POST
    • OpenAI image generation
      POST
    • OpenAI image edit
      POST
    • OpenAI image edit (legacy alias)
      POST
  • Claude
    • Claude chat completion
      POST
    • Claude message
      POST
  • DeepSeek
    • DeepSeek chat completion
      POST
    • DeepSeek chat completion
      POST
  • Gemini
    • Gemini content
      POST
  • Seedance
    • Seedance video generation
      POST
    • Retrieve Seedance task
      GET
  • Kling
    • Kling text-to-video
      POST
    • Retrieve Kling text-to-video task
      GET
    • Kling image-to-video
      POST
    • Retrieve Kling image-to-video task
      GET
  • Veo
    • Veo video generation
      POST
    • Fetch Veo video generation status
      POST
  • Schemas
    • ChatCompletionRequest
    • ImageGenerationRequest
    • ChatMessage
    • ImageEditRequest
    • Tool
    • ImageGenerationResponse
    • ToolCall
    • ChatCompletionResponse
    • ChatCompletionChoice
    • ContentFilterResults
    • UsageInfo
    • EmbeddingRequest
    • EmbeddingResponse
    • TranscriptionRequest
    • TranscriptionResponse
    • ClaudeMessageRequest
    • ClaudeMessageResponse
    • VideoCreateRequest
    • VideoResponse
    • VideoRemixRequest
    • GeminiGenerateContentRequest
    • VideoListResponse
    • GeminiContent
    • VideoDeleteResponse
    • GeminiGenerationConfig
    • ResponseRequest
    • GeminiGenerateContentResponse
    • ResponseObject
    • SeedanceTaskRequest
    • SeedanceTaskCreateResponse
    • SeedanceTaskResponse
    • KlingText2VideoRequest
    • KlingImage2VideoRequest
    • KlingTaskResponse
    • KlingTaskDetailResponse
    • KlingTaskListResponse
    • VeoGenerateRequest
    • VeoOperationResponse
    • VeoFetchOperationRequest
    • VeoFetchOperationResponse
  1. OpenAI

OpenAI image generation

POST
https://ai.tikhub.io/v1/images/generations
OpenAI
Generates one or more images from a text prompt using OpenAI image models.

Supported Models#

gpt-image-2
gpt-image-2-vip

Notes#

background, output_format, output_compression, and moderation apply only to gpt-image-* models.
output_compression is only meaningful when output_format is jpeg or webp.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Example
{
    "model": "gpt-image-2",
    "prompt": "string",
    "n": 1,
    "size": "256x256",
    "quality": "low",
    "response_format": "url",
    "style": "vivid",
    "background": "transparent",
    "output_format": "png",
    "output_compression": 0,
    "moderation": "low",
    "user": "string"
}

Request Code 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 'https://ai.tikhub.io/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-image-2",
    "prompt": "string",
    "n": 1,
    "size": "256x256",
    "quality": "low",
    "response_format": "url",
    "style": "vivid",
    "background": "transparent",
    "output_format": "png",
    "output_compression": 0,
    "moderation": "low",
    "user": "string"
}'

Responses

🟢200
application/json
Successful response
Bodyapplication/json

Example
{
    "created": 0,
    "data": [
        {
            "url": "string",
            "b64_json": "string",
            "revised_prompt": "string"
        }
    ]
}
🟠400
🟠401
🟠429
🔴500
Modified at 2026-05-04 13:50:36
Previous
OpenAI chat completion
Next
OpenAI image edit
Built with