Website
  1. Images
  • Start
    • Product Intrduction
    • Quick to use
    • Using Nexhina in AI Coding Tools
  • API integration explanation
    • HTTP Status Codes
    • Getting an API Key
    • Authentication
    • Quick Start
    • Streaming Output Guide
    • Request URL
  • API Endpoints
    • Chat
      • Chat Completion
    • Models
      • List Available Models
    • Responses
      • Responses API
    • Embeddings
      • Text Embedding
    • Images
      • Generate Image
        POST
    • Audio
      • Text-to-Speech (TTS)
      • Speech-to-Text (STT)
      • Audio Translation
    • Video
      • Generate Video
    • Moderation
      • Content Moderation
    • Rerank
      • Rerank
  • Platform-related
    • Platform agreement
    • Privacy Policy
    • General Questions
  • Schemas
    • ChatRequest
    • Log
    • ChatMessage
    • ToolCall
    • User
    • FunctionDefinition
    • Channel
    • ToolDefinition
    • Token
    • ChatCompletionRequest
    • Redemption
    • ChatCompletionChoice
    • ChatCompletionResponse
    • ChatCompletionChunk
    • ResponseInputText
    • ResponseRequest
    • ResponseOutputText
    • ResponseOutputMessage
    • ResponseObject
    • EmbeddingRequest
    • EmbeddingData
    • EmbeddingResponse
    • ImageGenerationRequest
    • ImageData
    • ImageUsageInputTokensDetails
    • ImageUsage
    • ImageGenerationResponse
    • SpeechRequest
    • TranscriptionRequest
    • TranslationRequest
    • TranscriptionResponse
    • TranslationResponse
    • VideoGenerationRequest
    • VideoData
    • VideoGenerationResponse
    • ModerationRequest
    • ModerationCategory
    • ModerationResult
    • ModerationResponse
    • RerankRequest
    • RerankResult
    • RerankResponse
  1. Images

Generate Image

POST
/v1/images/generations
Generate images from text prompts.
Size Reference:
ModelSupported Sizes
wanx-v21024x1024 / 720x1280 / 1280x720 / auto
cogview-41024x1024 / 768x1344 / 1344x768
cogview-3-plus1024x1024 / 768x1344 / 1344x768

Request

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

Body Params application/jsonRequired

Example
{
    "model": "wanx-v2",
    "prompt": "Futuristic technology city",
    "size": "1024x1024",
    "quality": "high",
    "n": 1
}

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 '/v1/images/generations' \
--header 'X-Request-Id;' \
--header 'X-Tenant-Id;' \
--header 'X-Channel;' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "wanx-v2",
    "prompt": "Futuristic technology city",
    "size": "1024x1024",
    "quality": "high",
    "n": 1
}'

Responses

🟢200
application/json
Successfully returns images
Bodyapplication/json

Example
{
    "created": 1713833628,
    "data": [
        {
            "url": "https://cdn.example.com/img-001.png"
        }
    ],
    "usage": {
        "total_tokens": 100,
        "input_tokens": 50,
        "output_tokens": 50,
        "input_tokens_details": {
            "text_tokens": 10,
            "image_tokens": 40
        }
    }
}
🟠401
Modified at 2026-06-29 09:22:57
Previous
Text Embedding
Next
Text-to-Speech (TTS)
Built with