Skip to content

AI Image Generation API Guide ​

This page explains how to call the platform's image generation API.

1. Quick Start ​

OpenAI-compatible API base URL:

text
BASE_URL=https://www.yusr.ai/v1

Gemini native API base URL:

text
BASE_URL=https://www.yusr.ai

Use Bearer Token authentication:

http
Authorization: Bearer sk-your-api-key

2. API Overview ​

ScenarioEndpoint
Text to imagePOST /v1/images/generations
Image editing / reference image generationPOST /v1/images/edits
Responses image generationPOST /v1/responses
Gemini native image generationPOST /v1beta/models/{model}:generateContent

3. Text-to-Image Example ​

bash
curl "$BASE_URL/images/generations" \
  -H "Authorization: Bearer sk-xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-3.0-generate-002",
    "prompt": "An orange cat sitting on a cyberpunk street, cinematic, ultra-detailed",
    "n": 1,
    "size": "4096x2304",
    "quality": "4k"
  }'

4. FAQ ​

  • Text to image: images/generations
  • Reference image / editing: images/edits
  • gpt-4o / gpt-5: responses
  • Gemini: v1beta/models/{model}:generateContent

Released under the MIT License.