ai

Generate images from a text prompt across the gateway's...

Generate images from a text prompt across the gateway’s image models (gpt-image, Gemini image, FLUX, Grok Imagine, …) on one endpoint. POST { model, prompt, n?, size? } → OpenAI-style { created, data: [{ b64_json }] }. Pay per call in USDC via x402 — no accounts or provider keys. Priced per model from $0.03/image (quoted in the 402). List models at GET /api/ai/models. Billing: payment settles before this endpoint runs (paid upstream), so an error after settlement IS charged — the error response then carries the payment receipt (PAYMENT-RESPONSE) and X-2s-Charged: true.

post/api/ai/image

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/ai/image
  • Auth: API key in header PAYMENT-SIGNATURE

Request body

modelstring required

Gateway image model id, e.g. openai/gpt-image-1, google/gemini-3-pro-image, black-forest-labs/flux-1.1-pro.

promptstring required

Text prompt.

ninteger

Number of images (1-4, default 1).

sizestring

Optional WxH, e.g. 1024x1024.

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.