Skip to content

YexAPI documentation

YexAPI gives you access to gpt-image-2 image generation through an OpenAI-compatible API. If you already use the official OpenAI SDKs, you only need to change the base URL and the API key.

Base URL https://api.yexapi.com/v1
Authentication Authorization: Bearer <YOUR_API_KEY>
Model gpt-image-2
Pricing $0.025 (1K) · $0.035 (2K) · $0.045 (4K) per image, see Billing

Two ways to generate

  • Synchronous: POST /v1/images/generations works exactly like the OpenAI Images API. The request waits until the image is ready (typically 30–60 seconds) and returns its URL. See Synchronous generation.
  • Asynchronous: POST /v1/images/generations/async returns a task ID immediately, and you poll GET /v1/images/generations/{task_id} for the result. Use this for 4K images, long prompts or batch jobs. See Async tasks & status.

Both paths are billed per image, and failed generations are refunded automatically.

Next steps

  1. Quickstart: create a key and generate your first image.
  2. Size & output pixels: how size and resolution work.
  3. Migrating from OpenAI: what is different.

Need help? Email support@yexapi.com or message us on Telegram (link coming soon). We answer integration questions one-on-one.