81trust / 100

Images Generations

by OpenAI image generation in AI models & inference

x402 APIPassing, checked 41 min ago

OpenAI image generation (gpt-image-2.5, gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, chatgpt-image-latest), paid per call in USDC. OpenAI list rates per 1M image tokens (1024x1024 low = 196 tokens on gpt-image-2), plus $0.0005 (Base) or $0.0005 (Solana) per call. Send size and quality (auto is refused); omitted means 1024x1024 medium. Returns b64_json. One endpoint per model: /x402/v1/models/<key>/images/generations. Rates: https://openai.mm.family/x402/pricing

POST https://openai.mm.family/x402/v1/images/generations

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
34 ms typical, 34 ms slowest 5%
Last check
41 min ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://openai.mm.family/x402/v1/images/generations" \
  -H "content-type: application/json" \
  -d '{"model":"gpt-image-2","n":1,"prompt":"A red fox in the snow","quality":"low","size":"1024x1024"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fopenai.mm.family%2Fx402%2Fv1%2Fimages%2Fgenerations
const res = await pay("https://openai.mm.family/x402/v1/images/generations", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"model":"gpt-image-2","n":1,"prompt":"A red fox in the snow","quality":"low","size":"1024x1024"}),
});
console.log(await res.json());

Example input

{
  "model": "gpt-image-2",
  "n": 1,
  "prompt": "A red fox in the snow",
  "quality": "low",
  "size": "1024x1024"
}

Example output

{
  "created": 1,
  "data": [
    {
      "b64_json": "<base64 png>"
    }
  ],
  "output_format": "png",
  "quality": "low",
  "size": "1024x1024",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 196,
    "total_tokens": 208
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
41 min agoPassed402220 ms$0.0035
6 h agoPassed40234 ms$0.0035